0 Replies Latest reply on Feb 23, 2011 3:44 PM by iamcootis

    extract XML from XMLList and append new node

    iamcootis Level 1

      I want to be able to extract XML from an XMLList and append a new node to that piece of XML.

       

      For instance, let's say I have this XMLList:

       

      <testmodel group="1" network="Switching" dut=" Default" bandwidth="20000.0" bandwidthPercent="12.5" duration="33.0" name="Test" maxBandwidth="160000.0" rcvBandwidth="20000.0" rcvBandwidthPercent="12.5" rcvMaxBandwidth="160000.0" testLabType="lte" author="admin" category="User" createdBy="admin" createdOn="2011-02-23T15:38:47" timestamp="2011-02-23T15:38:47" class="custom" revision="2" saved="true" canSave="true" valid="warning">
        <exerciseit duration="300"/>
        <lab num="1" base="240011234567000" base2="123456789" Profile="User" apn="internet" numE="1" netaddr="10.0.1.0" netmask="24" gateway="10.0.1.1" startingIP="10.0.1.18" dnsServerIP="10.0.1.3" domainName="example." pdn_netaddr="10.0.1.0" pdn_netmask="24" pdn_gateway="10.0.1.1">
          <me>
            fubar
          </me>
        </lab>
        <label>
          <string>
            Custom
          </string>
        </label>
      </testmodel>

       

      I want to be able to extract the lab so all I will have is:

       

      <lab num="1" base="240011234567000" base2="123456789" Profile="User"  apn="internet" numE="1" netaddr="10.0.1.0" netmask="24"  gateway="10.0.1.1" startingIP="10.0.1.18" dnsServerIP="10.0.1.3"  domainName="example." pdn_netaddr="10.0.1.0" pdn_netmask="24"  pdn_gateway="10.0.1.1">
           <me>
             fubar
           </me>
         </lab>

       

      Once I have this I want to be able to append and/or remove an <me> node from this XML. How would I make this happen in AS3?