C3 XML Question

A

Asim Qazi

Hi All,

i m trying to Edit a Node which is CDATA, here is the code.

XE.Load(fileName);

XmlNode xIpLessDomainIP =
xWebServerRole.SelectSingleNode("//data/info[@name='ipless-domain-ip']");
xIpLessDomainIP.InnerText = "TestIPTest";


XE is a object of XMLDocument, it runs successfully but removes the CDATA
Section from the Node.

Any Help would be appriciateable

Thanks
Asim
 
J

Jon Skeet [C# MVP]

Asim Qazi said:
i m trying to Edit a Node which is CDATA, here is the code.

XE.Load(fileName);

XmlNode xIpLessDomainIP =
xWebServerRole.SelectSingleNode("//data/info[@name='ipless-domain-ip']");
xIpLessDomainIP.InnerText = "TestIPTest";


XE is a object of XMLDocument, it runs successfully but removes the CDATA
Section from the Node.

Well, you're completely replacing the inner text, so I'm not entirely
surprised it's removing the existing text. Have you tried appending
child text nodes instead of setting the InnerText property?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top