Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Edit a file
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01416197
Message ID:
01416340
Vues:
64
>You've to use FILETOSTR() to read XML into a string first. See correction inline
>
>>I tried the following:
>>
>>
>cTagName = STREXTRACT(FILETOSTR("C:\test2\PayRegExtract.xml"),"<table1>","</table1>",1,1)
>>MESSAGEBOX(cTagName,0,'')
>>
>>
>>and it yield empty value.
>>


Thanks, that worked great. I formatted my XML correctly and now I'm trying to get it into my cursor. The problem is that all the columns I selected (statement # 7) when creating the cursor disappeared and the cursor now contains an empty "Detail" column. I use the 512 on parameter after trying all the other parameter in the XMLTOCURSOR statement. Here is my code:
1  cPreTag = '<?xml version = "1.0"?><Report>'
2  cPostTag = "</Report>"
3  cTagName = STREXTRACT(FILETOSTR("C:\test2\PayRegExtract.xml"),"<Table1>","</Table1>",1,1)
4  cPassTag = cPreTag+cTagName+cPostTag
5  MESSAGEBOX(cPassTag,0,'')
6  STRTOFILE(cPassTag,"C:\test2\convert.xml",0)
7  SELECT * from xfer_payroll INTO CURSOR crsparse readwrite
8  XMLTOCURSOR("C:\test2\convert.xml","crsparse",512)
The XML looks as follows:
<?xml version = "1.0"?><Report><Detail_Collection><Detail PP="2009-14" NAME="ABBATOYE ........
I have also attach a sample of xml layout and the cursor before and after the import. Do you guys see anything wrong with my xml format that prevents me from bring it back into a cursor?

Thank
nick
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform