Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting hierarchical xml to vfp
Message
 
To
16/08/2002 09:57:20
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Miscellaneous
Thread ID:
00690345
Message ID:
00690380
Views:
20
Code below will give you a start. Also here are two articles I would recommend:
*HOWTO: Use FoxPro and MSXML to Return Information About an XML Document (Q253732)
*http://support.microsoft.com/default.aspx?scid=kb;EN-US;q253732
*with addition from Advisor "ACCESS VB-SQL", Nov 2000, p20,
* article "MSXML: XML in Action" by Ken Getz
*-------------------------------------------------

lnfp=fopen(fullpath("test.xml"))
if lnfp>0
=fclose(lnfp)
else
return &&file must not be open anywhere
endif

oXML=CREATEOBJECT('msxml.domdocument')

oXML.LOAD(fullpath("test.xml"))
with oxml.documentelement
? .childnodes(0).Text
? .childnodes(1).Text
with .childnodes(2)
? .childnodes(0).Nodename
? .childnodes(0).childnodes(0).Text
? .childnodes(0).childnodes(1).Text

? .childnodes(1).childnodes(0).Text
? .childnodes(1).childnodes(1).Text
endwith
endwith

oXMl=.NULL.
release oXML

*---------------------------- with oxml.documentelement
*
*
* 11009 .childnodes(0).Text
* 20020801 .childnodes(1).Text
*
*
* 80686001508 .childnodes(2).childnodes(0).childnodes(0).Text
* 2 .childnodes(2).childnodes(0).childnodes(1).Text
*

*
* 2136861443 .childnodes(2).childnodes(1).childnodes(0).Text
* 4.5 .childnodes(2).childnodes(1).childnodes(1).Text
*

*

*
Previous
Reply
Map
View

Click here to load this message in the networking platform