How to modify exiting XML file with XmlDocument and XmlNode in C#

Posted by Nano HE on Stack Overflow See other posts from Stack Overflow or by Nano HE
Published on 2010-04-01T07:25:26Z Indexed on 2010/04/01 7:33 UTC
Read the original article Hit count: 284

Filed under:
|
|
|

I already implemented to create the XML file below with XmlTextWriter when application initialization.

And know I don't know how to update the childNode id value with XmlDocument & XmlNode.

Is there some property to update the id value? I tried InnerText but failed. thank you.

<?xml version="1.0" encoding="UTF-8"?>
<Equipment xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <License licenseId="" licensePath=""/>
  <DataCollections>
    <GroupAIDs>
      <AID id="100">
        <Variable id="200"/>
        <Variable id="201"/>
      </RPTID>
      <AID id="">
        <ReportVariable id="205"/>
      </AID>
      <AID id="102"/>
    </GroupAIDs>
    <GroupBIDs>
      <BID id="2000">
        <AID id="100"/>
      </BID>
      <BID id="2001">
        <AID id="101"/>
        <AID id="102"/>
      </BID>
    </GroupBIDs>
    <GroupCIDs>
      <BID id="8"/>
      <BID id="9"/>
      <BID id="10"/>
    </GroupCIDs>
  </DataCollections>
</Equipment>

© Stack Overflow or respective owner

Related posts about c#

Related posts about Xml