I have a large xml file with several nodes slide
and the below is a part of my large xml.
<slide add_info="e" name="slide31.xml" nav_lvl_1="Contact" nav_lvl_2="Company" >
--------something----------
</slide>
<slide add_info="a" name="slide32.xml" nav_lvl_1="References" nav_lvl_2="Company">
-----something----
</slide>
<slide add_info="b" name="slide33.xml" nav_lvl_1="References" nav_lvl_2="Company" >
------something--------
</slide>
<slide add_info="c" name="slide34.xml" nav_lvl_1="References" nav_lvl_2="Company" >
--------something----------
</slide>
<slide add_info="d" name="slide34.xml" nav_lvl_1="Contact" nav_lvl_2="Company" >
--------something----------
</slide>
Here i need to group only the slide
node which has attribute References
and Company
and get the all the add_info
attribute values
of those nodes.For example
expected output:
a b c
Currently I am doing :
<xsl:choose>
<xsl:when test="@nav_lvl_1='References'">
<xsl:if test="@nav_lvl_2='Company'">
<xsl:for-each select="//@add_info">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:if>
</xsl:when>
</xsl:choose>
But this gives me all
the text value of add_info
attribute in the whole document.For example:
it gives me:
e a b c d
But I need the output only as a b c
How could i change the above xslt
code to achieve that.. Any sugggestions..I am stuck here :(