10-22-2016, 04:22 PM
Sorry for this basic question, I could swear I have seen this covered somewhere in the forum but can not find topic anymore.
I get the below error if I read a xml file with an '&' in it.
Macro Macro4
I used code from helpfile to explain.
The error always occurs at first occurence of '&'
Content of 's' comes from file. (originally the it was x.FromFile(xmlfile))
The only way I can think of is replace '&' with it's character code [38] just before 'FromString' and then replacing it back just before 'ToString'?
Is there a better/propper way? Or should I use character code replacement method?
I get the below error if I read a xml file with an '&' in it.
Quote:0x80070057, The parameter is incorrect.
Macro Macro4
str s=
;<?xml version="1.0" ?>
;<rootelem>
,;<elem>
,,;<cc>&text of cc 2</cc>
,;</elem>
;</rootelem>
IXml x=CreateXml
x.FromString(s)
err
,out x.XmlParsingError
I used code from helpfile to explain.
The error always occurs at first occurence of '&'
Content of 's' comes from file. (originally the it was x.FromFile(xmlfile))
The only way I can think of is replace '&' with it's character code [38] just before 'FromString' and then replacing it back just before 'ToString'?
Is there a better/propper way? Or should I use character code replacement method?