Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XMLTOCURSOR() with invalid characters
Message
 
 
To
27/07/2016 01:31:27
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01638686
Message ID:
01638729
Views:
203
>>>>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, "" )
>
Thank you, Antonio. Your solution works.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform