Rafael, 

The MSXML parser might be what you want. Below I've pasted a prg I had
found a while back to test with (but then switched to using VFP commands
for the limited case I needed to work with). 

For the current version of the parser, search the MS website for MSXML.


Bill


*           This is a simple example that shows how to return values
from an XML
*           document using Microsoft Visual FoxPro.
*
*
*           MORE INFORMATION
*           This example uses the Microsoft XML (MSXML) parser to move
data from
*           an XML document to a FoxPro table. The parser is available
at:
*             http://msdn.microsoft.com/xml/default.asp
*           NOTE: The Microsoft XML parser is not yet a released
product.
*
*           The following code creates the Microsoft MSXML ActiveX
object to
*           accesses information contained in an XML document and
displays it:
*             Install the MSXML parser.
*
*
*             Create the XML document by copying the sample XML code
below to a
*             text file and name the file with the extension .
*
*
*             Create a FoxPro program file with the following code and
run the
*             program:
*

PUBLIC oXML


oXML=CREATEOBJECT('msxml.domdocument')  && This creates the parser
object
oXML.LOAD("myxmldoc.xml")                         && This gets and loads
the XML document.

*** The following gives the basename / RootElemant of the XML document ?
oXml.DocumentElement.Basename

*** The following gives the number of nodes (or records)
? oXML.documentelement.childnodes.LENGTH

*** REMEMBER that the object model is in base zero.
*** Therefore use the following in looping expressions
? oXML.documentelement.childnodes.LENGTH - 1

*** The following returns the number of child nodes contained under
*    the first Item
*** This is useful for looping through a childes elements
*** FOR ichild = 0
*    TO oXML.documentelement.childnodes.ITEM(0).childnodes.LENGTH - 1

? oXML.documentelement.childnodes.ITEM(0).childnodes.LENGTH - 1

*** The following returns the nodename of the childnode
* oxml.documentelement.childnodes.item(0).childnodes(0).nodename
? oxml.documentelement.childnodes.item(0).childnodes(1).nodename

* oxml.documentelement.childnodes.item(1).childnodes(0).nodename
? oxml.documentelement.childnodes.item(1).childnodes(1).nodename

* oxml.documentelement.childnodes.item(2).childnodes(0).nodename
? oxml.documentelement.childnodes.item(2).childnodes(1).nodename

*** The following returns the data contained in the childnode
? oXML.documentelement.childnodes.ITEM(0).childnodes(0).TEXT

*** Returns a string of all the data contained in the second child /
record ? oXml.documentelement.childnodes.item(1).nodetypedvalue
? oXml.documentelement.childnodes.item(2).nodetypedvalue
? oXml.documentelement.childnodes.item(3).nodetypedvalue
? oXml.documentelement.childnodes.item(4).nodetypedvalue
? oXml.documentelement.childnodes.item(5).nodetypedvalue
? oXml.documentelement.childnodes.item(6).nodetypedvalue
? oXml.documentelement.childnodes.item(7).nodetypedvalue



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to