Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Tore Bleken
  Where is Tore Bleken?
 Stokke
 Norway
 Tore Bleken
 To: Michael Johnson
  
 
 
 Michael Johnson
 Tags
Subject: RE: XML to Table
Thread ID: 393923 Message ID: 393927 # Views: 46 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: XML
Date: Thursday, December 26, 2013 12:16:54 PM         
   


> > This file doesn't follow the standard at all, I am tempted to say that it's not an xml-file! You will have to parse it manually. You can use Strextract() to separate each record.
> >
> > ?strextract(lcXml,'<Item ','/>',1)
> > ?strextract(lcXml,'<Item ','/>',2)
> > 

> > You can also use Strextract() to separate each field value from the records.
> >
>
>
> Thanks.
>
> I Can Use Strextract() Function.
> But How to determine how much the number of >
> Thanks Again.
>
> - Tuberose

VFP has many ways, for instance GetWordCount(). Another possibility is to simply check for an empty return value.

lnX=1
Do while .T.
   lcRecord=strextract(lcXml,'<Item ','/>',lnX)
   if empty(lcRecord)
      exit
   endif
   lnX = lnX + 1
   * Do some processing here
Enddo

And please fill in more private details in your profile!


There's a fine line between helping and adding to the confusion.

How to create sample data

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