get element all attribute and set as list view

masonberlin

New Member
my xml file:-\[code\]<child_2 entity_id="2" value="http://stackoverflow.com/questions/15727036/Root" parent_id="1"> <child_4 entity_id="4" value="http://stackoverflow.com/questions/15727036/Activities" parent_id="2"> <child_10066 entity_id="10066" value="http://stackoverflow.com/questions/15727036/Physical1" parent_id="4"> <child_10067 entity_id="10067" value="http://stackoverflow.com/questions/15727036/Cricket" parent_id="10066"> <child_10068 entity_id="10068" value="http://stackoverflow.com/questions/15727036/One Day" parent_id="10067"/> </child_10067> </child_10066> <child_10069 entity_id="10069" value="http://stackoverflow.com/questions/15727036/Test2" parent_id="4"/> <child_10070 entity_id="10070" value="http://stackoverflow.com/questions/15727036/Test3" parent_id="4"/> <child_10071 entity_id="10071" value="http://stackoverflow.com/questions/15727036/Test4" parent_id="4"/> <child_10072 entity_id="10072" value="http://stackoverflow.com/questions/15727036/Test5" parent_id="4"/> <child_5 entity_id="5" value="http://stackoverflow.com/questions/15727036/Physical" parent_id="4"/> </child_4> </child_2>\[/code\]i want to find all \[code\]child_4\[/code\] and there \[code\]child\[/code\] element attribute \[code\]value\[/code\] list and want to display as a list type...i want to this type of output:- click on \[code\]Activities\[/code\]
\[code\]Physical1\[/code\]
\[code\]Test2\[/code\]
\[code\]Test3\[/code\]
\[code\]Test4\[/code\]
\[code\]Test5\[/code\]
\[code\]Physical\[/code\]
if click on \[code\]Physical1\[/code\]
\[code\]Cricket\[/code\]
if click on \[code\]Cricket\[/code\]
\[code\]One Day\[/code\].

i am try this xslt:-\[code\]<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" /> <xsl:template match="*"> <xsl:apply-templates select="ancestor::*" mode="spacing" /> <xsl:value-of select="@value"/> <xsl:text>
</xsl:text> <xsl:apply-templates select="*" /> </xsl:template> <xsl:template match="*" mode="spacing"> <xsl:text> </xsl:text> </xsl:template></xsl:stylesheet>\[/code\]
 
Back
Top