C3 XML Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Asim Qazi

    #1

    C3 XML Question

    Hi All,

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

    XE.Load(fileNam e);

    XmlNode xIpLessDomainIP =
    xWebServerRole. SelectSingleNod e("//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







  • Jon Skeet [C# MVP]

    #2
    Re: C3 XML Question

    Asim Qazi <qazi@advcomm.n et> wrote:[color=blue]
    > i m trying to Edit a Node which is CDATA, here is the code.
    >
    > XE.Load(fileNam e);
    >
    > XmlNode xIpLessDomainIP =
    > xWebServerRole. SelectSingleNod e("//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.[/color]

    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?

    --
    Jon Skeet - <skeet@pobox.co m>
    Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

    If replying to the group, please do not mail me too

    Comment

    Working...