Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: How to insert CDATA section using XPathNavigator ? >Thread Next - Re: How to insert CDATA section using XPathNavigator ? Re: How to insert CDATA section using XPathNavigator ?To: NULL Date: 6/1/2006 10:17:00 AM
Thanks for the suggestions. However, the following line:
writer.WriteCData("data string");
did not create the <![CDATA[...]]> block. It just wrote the data string by
itself.
Thanks,
Eric.-
"Ion Vasilian" wrote:
> Hi Eric,
>
> Assuming that you're trying to modify a XmlDocument using its XPathNavigator
> implementation, you should be able to generate a CDATA section using
> XmlWriter's WriteCData() as follows:
> static void Main()
> {
> XmlDocument document = new XmlDocument();
> document.LoadXml("<root/>");
> XPathNavigator navigator =
> document.DocumentElement.CreateNavigator();
> using (XmlWriter writer = navigator.AppendChild())
> {
> writer.WriteCData("character data");
> }
> document.Save(Console.Out);
> }
>
> Ion
>
> "ericms" <ericms@d...> wrote in message
> news:2839D937-CB0B-4DE7-B71F-7FC6EA90285E@m......
> > How do I insert a CDATA section using XPathNavigator ?
> >
> > Thanks,
> > Eric.-
> >
>
>
>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
