A
adMjb
Hi, I want to count the tags within another tag, I have been trying the
count children, count this, count that, but had no luck, can anyone
help please. i.e:
XML
===========
<root>
<person>
<name>Adam</name>
<name>John</name>
<name>Mark</name>
<age>10</age>
</person>
<person>
<name>Jim</name>
<name>Jill</name>
</person>
</root>
=============
what I want is to count the name tag within person and desplay with an
attribute name="?" i.e:
=============
<root>
<person name="3">
<name>Adam</name>
<name>John</name>
<name>Mark</name>
<age>10</age>
</person>
<person name="2">
<name>Jim</name>
<name>Jill</name>
</person>
</root>
=============
count children, count this, count that, but had no luck, can anyone
help please. i.e:
XML
===========
<root>
<person>
<name>Adam</name>
<name>John</name>
<name>Mark</name>
<age>10</age>
</person>
<person>
<name>Jim</name>
<name>Jill</name>
</person>
</root>
=============
what I want is to count the name tag within person and desplay with an
attribute name="?" i.e:
=============
<root>
<person name="3">
<name>Adam</name>
<name>John</name>
<name>Mark</name>
<age>10</age>
</person>
<person name="2">
<name>Jim</name>
<name>Jill</name>
</person>
</root>
=============