Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replace Less Than and Greater Than in an XML strin
Message
From
17/10/2018 17:55:44
 
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Miscellaneous
Thread ID:
01662634
Message ID:
01662646
Views:
41
>Hi,
>
>The suggestion from Antonio Lopes and Borislav to replace Ampersand (to &emp;) in an XML string is very helpful.
>
>But I also need to replace the greater than
(>)
and less than
(<)
symbols in the XML string. Since my initial string has these symbols for "business" reasons, I cannot use the STRTRAN() suggested by Antonio (since it will replace all the "business/necessary") symbols. So, when storing the data in the table field I need to convert the values of < and > to something else. I can change them to > but then it will look "strange" to the user, when they view it in the report.
>
>I am thinking of double left pointing angle and double right pointing angle (
<< and >>
). But I cannot find their CHR(#) value. Where do I find them (if they exist in VFP)?

Hi, Dmitry.

I'm not quite following you in this. When you XMLTOCURSOR() the STRTRANslated strings, you'll get < in the resulting cursor, not &lt;. That is
XMLTOCURSOR("<root><row><field1>&lt;</field1></row></root>", "test")
? test.field1
will print
<
because that will be content of the imported field, and that is what your users will see. Are you getting something else?
----------------------------------
António Tavares Lopes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform