You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "EXTERN Burkhardt Martin (ISS; GS/EMW2)" <Ma...@de.bosch.com> on 2002/09/25 15:52:34 UTC

Decode CDATASection Content

Hi,

I'm new to the list, have been lurking for a while. I'm in the midst of a
software project using Xerces 2.1. I've got a problem with some string
content, which I put into a CDATASection. The string contains characters
like e.g. '<', which is encoded to "&lt;".

When I access the CDATASection content later (after saving and reading the
XML file) using 

if(pNode->getNodeType() == Node::CDATA_SECTION_NODE)
{
	const XMLCh * strContent = pNode->getNodeValue();
}

I get a string, in which the special characters are still encoded. How can I
get the decoded string back again!?

Any help greatly appreciated.

Regards,

Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: Decode CDATASection Content

Posted by Gareth Reakes <ga...@decisionsoft.com>.
Hi,
	unlike text in attribute values and in element content, nothing 
happens to the encoding of characters in CDATA sections during parse. So 
the node value of

<![CDATA[&lt;]]>

would be &lt;

and the node value of

<![CDATA[<]]>

would be <

I hope this explains what you wanted, if not mail again.


Gareth


On Wed, 25 Sep 2002, EXTERN Burkhardt Martin (ISS; GS/EMW2) wrote:

> Hi,
> 
> I'm new to the list, have been lurking for a while. I'm in the midst of a
> software project using Xerces 2.1. I've got a problem with some string
> content, which I put into a CDATASection. The string contains characters
> like e.g. '<', which is encoded to "&lt;".
> 
> When I access the CDATASection content later (after saving and reading the
> XML file) using 
> 
> if(pNode->getNodeType() == Node::CDATA_SECTION_NODE)
> {
> 	const XMLCh * strContent = pNode->getNodeValue();
> }
> 
> I get a string, in which the special characters are still encoded. How can I
> get the decoded string back again!?
> 
> Any help greatly appreciated.
> 
> Regards,
> 
> Martin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 
> 

-- 
Gareth Reakes, Head of Product Development  
DecisionSoft Ltd.            http://www.decisionsoft.com
Office: +44 (0) 1865 203192



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org