Archived Forum Post

Index of archived forum posts

Question:

HELP! - getXML() -- Returns HTMLEncoded

Oct 18 '13 at 11:20

We noticed that the getXML() method returns the content of nodes HTML Encoded.

<product>Gauze 4" x 4"</product>
is returned as
<product>Gauze 4&quot; x 4&quot;</product>

If you get the content for the product node, xmlProduct.content, it would not be HTML Encoded.

We use getXML() to receive, pass, re-port, exchange the XML, so the pre-encoding does not help AT ALL. There are no parameters to getXML() that I know off.

Is there other ways to suppress this behavior and get an XML branch, or whole message, without HTML Encoding of the content?

Component: XML
Version: 9.4.1, ActiveX


Accepted Answer

Here are new builds that change the behavior so that double quotes and single quotes are not automatically entity encoded when in the XML content:

32-bit ActiveX: http://www.chilkatsoft.com/preRelease/ChilkatXml-9.4.1-win32.zip

64-bit ActiveX: http://www.chilkatsoft.com/preRelease/ChilkatXml_x64-9.4.1-x64.zip

An explanation: The xml.Content property returns the entity-decoded content of an XML node. However, the GetXml method returns the XML document, which would most certainly entity encoded special characters such as "<", "&", etc. Any software that is reading an XML document SHOULD and MUST be able to properly decode entities. This is not an error or bug in Chilkat, it's just a behavior that is technically correct and valid, but may not be preferred by some users. Any software that does not handle XML entities is not actually capable of parsing XML documents correctly.