Creating XML document

janmarcin
Kilo Contributor

Hello,

I need to create a XML document which should be in UTF-8 encoding. I have in the script large object which I want to convert to XML.

I have found "XMLHelper" class and "toXMLStr()" method which should do that.

What I have figured out is that this method "toXMLStr()" doesn't do any escaping of special characters which causes generating of invalid XML document.

Second thing is that I was not able to find any documentation related to this method regarding to encoding of XML document. Do you know when I use this method what is the encoding format of generated XML document?

Do you have maybe any other suggestion when I want to easily convert object structure to XML what method or class would be the best for escaping the special characters(<,>,...) and to get UTF-8 encoding?

thanks a lot

1 REPLY 1

gauravchoudhury
Tera Guru

Hi Jan,



You can refer to this link which may help you gain some insight to your problem.



Also, refer to this link if you would want to know about using special characters in an XML file.