FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Need explanation: FWH XML example
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM

Need explanation: FWH XML example

Posted: Sun Jul 16, 2017 05:45 PM
I have looked at the sample for xmlreader, and xmltree. Fine ... HOWEVER ... they are not helping

I have to get the data from a line like this:

Code (fw): Select all Collapse
       <nonoem-base-model><![CDATA[FUSION]]></nonoem-base-model>

 


The sample shows:
Code (fw): Select all Collapse
         MsgInfo( oTagActual:cName, oTagActual:cData )
         HEval( oTagActual:aAttributes, { | cKey, cValue | MsgInfo( cKey, cValue ) } )


Fine ... so oTagActual:cName returns the name ( ie. in this case nonoem-base-model ) which is great. cValue has the actual data I need: FUSION
However, I'm going around in circles. I need to save cValue to an array, and it simply is not happening, ie: aInfo[2] := cValue

The documentation, and samples, are so incomplete. Where can I find oTagActual array of attributes ? Since the Value is not in oTagActual:cData, is there some other handle ?

Sorry ... I looked at all the comments on this site ... but no joy.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM

Re: Need explanation: FWH XML example

Posted: Mon Jul 17, 2017 06:11 PM

Does no one work with XML in FWH / Harbour / xHarbour ?

The only posts I've seen refer back to the two samples that simply don't explain themselves.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM

Re: Need explanation: FWH XML example

Posted: Mon Jul 17, 2017 07:37 PM

Tim,

you may download the harbour source at: https://sourceforge.net/projects/harbou ... rce/3.0.0/

Included is a file \harbour-3.0.0\contrib\xhb\txml.prg which provides full source code for the classes TXMLNode and TXMLIterator (and some more). There you can find all methods and properties, maybe this can help you.
I'm no expert on xml file handling, but I suggest, if the source doesn't help you get a solution you might provide us a self containing sample (with xml file) and the array you want to build based on the sample.

Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 65
Joined: Fri Feb 13, 2009 12:03 PM

Re: Need explanation: FWH XML example

Posted: Wed Jul 19, 2017 02:18 AM

Hi Tim,

If you are using TXMLDocument and TXMLNode then oTagActual:aAttributes should be a hash table, then you can get all the attribute values using the function:

HGetValues(oTagActual:aAttributes) // will return an array containing all attribute values of a tag.

regards,
ryu

Continue the discussion