Re: How to insert a CDATA section using XPathNavigator ?
- From: "Ion Vasilian" <ionv at microsoft dot com>
- Date: Fri, 2 Jun 2006 10:44:12 -0700
Hi Eric,
Can you describe how you determined if it worked or not? Are you listing an
output file or maybe you just look for the expected data through
XPathNavigator. As I explained before, in the context of XPathNavigator a
CDATA section will surface as Text plus the markup (ie. "<![CDATA[", "]]>")
will be missing from the observable value.
Ion
"ericms" <ericms@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D9FCC5BF-C57C-4AA2-92B1-F5DC245E6F84@xxxxxxxxxxxxxxxx
I have tried it and the following did not work:
writer.WriteCData(dataString);
It did not add the <![CDATA]]> demiliters as you indicated.
I am using VisualStudio 2005, .NET 2.0.
Thanks,
Eric.-
"Martin Honnen" wrote:
ericms wrote:
And when I did the following :
using (XmlWriter writer = nav.AppendChild())
{
writer.WriteCData("<![CDATA[" + dataString + "]]>");
}
Everything is fine except that the "less than" sign is replaced with
ampersand, lt, semicolon and the greater sign is replaced with
ampersand, gt,
semicolon.
Simply do
writer.WriteCData(dataString);
do _not_ write out the <![CDATA]]> demiliters yourself, the writer will
add them directly when WriteCData is executed.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
.
- Follow-Ups:
- References:
- Re: How to insert a CDATA section using XPathNavigator ?
- From: Ion Vasilian
- Re: How to insert a CDATA section using XPathNavigator ?
- From: ericms
- Re: How to insert a CDATA section using XPathNavigator ?
- From: ericms
- Re: How to insert a CDATA section using XPathNavigator ?
- From: ericms
- Re: How to insert a CDATA section using XPathNavigator ?
- From: Ion Vasilian
- Re: How to insert a CDATA section using XPathNavigator ?
- From: ericms
- Re: How to insert a CDATA section using XPathNavigator ?
- From: Martin Honnen
- Re: How to insert a CDATA section using XPathNavigator ?
- Prev by Date: Re: Use of count() function with XPath
- Next by Date: Re: How to insert a CDATA section using XPathNavigator ?
- Previous by thread: Re: How to insert a CDATA section using XPathNavigator ?
- Next by thread: Re: How to insert a CDATA section using XPathNavigator ?
- Index(es):
Relevant Pages
|