Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Marco Plaza
  Where is Marco Plaza?
 Caracas
 Venezuela
 Marco Plaza
 To: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 Tags
Subject: RE: XML to Table
Thread ID: 393923 Message ID: 393983 # Views: 34 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: XML
Date: Friday, December 27, 2013 3:36:18 PM         
   


> >
> >
> > Strange behaviour indeed, but can be solved easily:
> >
> >
> >
> > 
> > text to cxml noshow
> > 
> > <xml name="getSendState" result="1">
> > 	<Item id="1" msgid="25021441091787400" mobile="19901764418" result="2" return="DELIVRD"/>
> > 	<Item id="2" msgid="25021441091787401" mobile="18901754419" result="1" return="DTBLACK"/>
> > 	<Item id="3" msgid="25021441091787402" mobile="18904754419" result="1" return="ACCEPTD"/>
> > 	<Item id="4" msgid="25021441091787403" mobile="18903754419" result="1" return="REJECTD"/>
> > 	<Item id="5" msgid="25021441091787404" mobile="18902754419" result="1" return="DELETED"/>
> > </xml>
> > 
> > endtext
> > 
> > k = createobject('MSxml.DOMDOCUMENT')
> > k.LoadXML(cxml)
> > create cursor messages ( id c(1), msgid c(17), mobile c(11), result c(1) , return c(7)) 
> > xmltocursor(K.selectNodes('/xml').item(0).xml,'messages',8192)
> > browse
> > 
> > 

>
> You can also ignore outer table with a direct XMLToCursor:
>
> text to cxml noshow
> 
> <xml name="getSendState" result="1">
> 	<Item id="1" msgid="25021441091787400" mobile="19901764418" result="2" return="DELIVRD"/>
> 	<Item id="2" msgid="25021441091787401" mobile="18901754419" result="1" return="DTBLACK"/>
> 	<Item id="3" msgid="25021441091787402" mobile="18904754419" result="1" return="ACCEPTD"/>
> 	<Item id="4" msgid="25021441091787403" mobile="18903754419" result="1" return="REJECTD"/>
> 	<Item id="5" msgid="25021441091787404" mobile="18902754419" result="1" return="DELETED"/>
> </xml>
> 
> endtext
> 
> create cursor messages ( id c(1), msgid c(17), mobile c(11), result c(1) , return c(7)) 
> xmltocursor(m.cxml,'messages',8192)
> browse
> 

>
>

> Cetin Basoz
>
> Give some sample data in code for your question - here is the tool you need to generate the code
>
> My Blog
>

> MongoDb Certified Developer
> MongoDb Certified DBA
>

> Support Wikipedia

Better yet!

ENTIRE THREAD

XML to Table Posted by michael johnson @ 12/26/2013 11:36:58 AM
RE: XML to Table Posted by Tore Bleken @ 12/26/2013 11:50:00 AM
RE: XML to Table Posted by michael johnson @ 12/26/2013 12:04:51 PM
RE: XML to Table Posted by Tore Bleken @ 12/26/2013 12:16:54 PM
RE: XML to Table Posted by Russell Hill @ 12/27/2013 4:02:48 AM
RE: XML to Table Posted by Marco Plaza @ 12/26/2013 2:54:43 PM
RE: XML to Table Posted by Anders Altberg @ 12/26/2013 4:22:30 PM
RE: XML to Table Posted by Marco Plaza @ 12/26/2013 11:12:11 PM
RE: XML to Table Posted by Cetin Basoz @ 12/27/2013 10:33:44 AM
RE: XML to Table Posted by Marco Plaza @ 12/27/2013 3:36:18 PM