Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XML to cursor
Message
 
To
04/04/2008 10:50:36
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01308173
Message ID:
01308664
Views:
24
This message has been marked as a message which has helped to the initial question of the thread.
**- Instatiate it
lo=CreateObject("Msxml2.DOMDocument.4.0")

**- Turn some of the validation switches off
lo.validateOnParse = .F.
lo.async = .F.
lo.resolveExternals = .F.

**- Load the xml document
?lo.loadXML("c:\temp\news.xml")

**- if it fails check why
If lo.parseError.errorCode <> 0
?lo.parseError.reason
Else
**- access node by name / one at time as in
loNode = lo.selectSingleNode('zimbabwe')
?loNode.getProperty("ElectionsResults")

**- or access
For each lonode in lo.childNodes
??lonode.
EndFor


EndIf

It's really down to what you want to do from there but get down to the node level and you will see what intellisense offers

I did try your example document though, and faild to load it successfully, reason being that it was not valid at the top.

Hopefully this helps



>Mathias,
>
>Not sure how to use this msxml object? Intellisense does not give me much insight ...
>
>
>>You might find xmldom class useful:
>>
>>lo=CreateObject("Msxml2.DOMDocument.4.0")
>>lo.loadXML("c:\temp\news.xml")
>>
>>Then parse through it node by node.
>>
>>
>>
>>>No, not quite. I got that too but it is not useful. I would like 1 record for each of the news items in the xml.
>>>
>>>
>>>
>>>>Jos,
>>>>
>>>>I did:
>>>>
>>>>XMLToCursor("c:\temp\news.xml", "abc", 512)
>>>>
>>>>Then browsed abc and it has 1 record in there. Is that what you were expecting?
>>>>
>>>>
>>>>>Hi All
>>>>>
>>>>>Can someone tell me the correct XMLTOCURSOR() synatx to convert this xml:
>>>>>
>>>>>http://news.google.com/news?ned=us&topic=w&output=rss
>>>>>
>>>>>Thanks
Mathias Banda

Time is longer than a rope.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform