Need explanation: FWH XML example

Need explanation: FWH XML example

Postby TimStone » Sun Jul 16, 2017 5: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: Select all  Expand view

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

 


The sample shows:
Code: Select all  Expand view

         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
User avatar
TimStone
 
Posts: 2897
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Need explanation: FWH XML example

Postby TimStone » Mon Jul 17, 2017 6: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
User avatar
TimStone
 
Posts: 2897
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Need explanation: FWH XML example

Postby gkuhnert » Mon Jul 17, 2017 7: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
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Re: Need explanation: FWH XML example

Postby ryugarai27 » Wed Jul 19, 2017 2: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
User avatar
ryugarai27
 
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 21 guests