darma teja

darma teja

  • NA
  • 496
  • 330.3k

XML nodes

Jun 30 2014 6:57 AM
Hi All,

I stuck here, Here is my scenario:

My xml data is like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<test>
<coun abbr="ind" id="1">
<stat name="prodct">clothes</stat>
<stat name="prodctin">blabla</stat>
<stat name="Produktout">blabla</stat>
<stat name="prodtype">dvskflh</stat>
</coun>
<coun abbr="can" id="2">
<stat name="prodct">clothes</stat>
<stat name="prodctin">blabla</stat>
<stat name="Produktout">blabla</stat>
<stat name="prodtype">dvskflh</stat>
</coun>
<coun abbr="usa" id="3">
<stat name="prodct">clothes</stat>
<stat name="prodctin">blabla</stat>
<stat name="Produktout">blabla</stat>
<stat name="prodtype">dvskflh</stat>
</coun>
<coun abbr="aus" id="4">
<stat name="prodct">clothes</stat>
<stat name="prodctin">blabla</stat>
<stat name="Produktout">blabla</stat>
<stat name="prodtype">dvskflh</stat>
</coun>
</test>


I want to save as new xml file with only the following data:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<test>
<coun abbr="ind" id="1">
<stat name="prodct">clothes</stat>
<stat name="prodctin">blabla</stat>
<stat name="Produktout">blabla</stat>
<stat name="prodtype">dvskflh</stat>
</coun>
</test>

Advance thanks,
Darma


Answers (3)