Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XMLTOCURSOR() with invalid characters
Message
De
27/07/2016 01:31:27
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01638686
Message ID:
01638713
Vues:
102
>>>Do I understand that I have to do it when storing the XML? For example, the current code of saving the cursor to XML is:
>>
>>Fox will do that for you if you mark the fields which may contain binaries as binary, i.e. NOCPTRANS. You don't have to change your tables, just create the cursor so and insert whatever you need into it. Then check the xml and you'll see proper CDATA wrapping.
>>
>>At least that's what I had to do back in VFP7, but I also think I had to do it a couple of years ago... well, if that 8 doesn't work, try this.
>>
>
>I must be missing something simple because even when I apply NOCPTRANS I don't see the CDATA in the XML.
>
>Here is the test code that I run:
>
>
>CREATE CURSOR C_TEST (field1 c(10), field2 c(100) NOCPTRANS)
>
>INSERT INTO C_TEST (field1, field2) VALUES ('123','blabla')
>		
>CURSORTOXML( "C_TEST", 'TEST.XML', 1, 512, 0, "" )
>
>
>The resulting TEXT.XML has not CDATA. What am I missing?

In CURSORTOXML, CDATA encoding applies only to Memo fields (with NOCPTRANS or not), but you have to raise the appropriate flag:
CREATE CURSOR C_TEST (field1 c(10), field2 M)

INSERT INTO C_TEST (field1, field2) VALUES ('123','blabla')

CURSORTOXML( "C_TEST", 'TEST.XML', 1, 512 + 8, 0, "" )
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform