Hello I got a question regarding looping through an xml document and return the sub-sub children (e.g. prop1, prop2, item1, item2, country1, country2) of the document element with their beloning children (e.g. person, name, address) element names.
I have the following XML document:
<data>
<person>
<properties>
<prop1>test</prop1>
<prop2>test</prop2>
</properties>
</person>
<name>
<properties>
<item1>test</item1>
<item2>test</item2>
</properties>
</name>
<address>
<properties>
<country1>test</country1>
<country2>test</country2>
</properties>
</address>
</data>
The desired output that I want is:
person prop1
person prop2
name item1
name item2
address country1
address country2
I managed to produce the following list: person name address
applying this XSLT transformation.:
<xsl:template match="*/*|@*">
<xsl:value-of select="name()"/>
<xsl:apply-templates select="@*"/>
</xsl:template>
Can anyone tell me what I should do? Thanks
properties, or grand-grandchildren of the root element, or elements that contain text, or ... ?