Reading multiple instances of a tag or element using XSLT
Posted
by shashank saket
on Stack Overflow
See other posts from Stack Overflow
or by shashank saket
Published on 2010-04-08T07:59:59Z
Indexed on
2010/04/08
8:53 UTC
Read the original article
Hit count: 552
My RDF xml file is something like this..
<rdf:RDF>
<rdf:Description rdf:about="........">
<j.0:property rdf:resource="....."/>
<j.0:property rdf:resource=....."/>
<j.0:property rdf:resource="........"/>
</rdf:Description>
</rdf:RDF>
Now in my XSLT stylesheet I need to retrieve the values of all the j.0:property
tags. I am using something like this:
<xsl:apply-templates select="j.0:property"/>
<xsl:template match="j.0:property">
<xsl:text><xsl:value-of select="/rdf:RDF/rdf:Description/j.0:propert /@rdf:resource"/></xsl:text>
</xsl:template>
But then it returns the same value 3 times. The value being the value of the first property encountered. Kindly help as to how I can get the value for each property.
© Stack Overflow or respective owner