Need explanation: FWH XML example

Post Reply
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Need explanation: FWH XML example

Post by TimStone »

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: Select all

       <nonoem-base-model><![CDATA[FUSION]]></nonoem-base-model>
 
 


The sample shows:

Code: Select all

         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
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Re: Need explanation: FWH XML example

Post by TimStone »

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
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
gkuhnert
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands
Contact:

Re: Need explanation: FWH XML example

Post by gkuhnert »

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
User avatar
ryugarai27
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines
Contact:

Re: Need explanation: FWH XML example

Post by ryugarai27 »

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
Post Reply