XML
<authors>
<author url="http://dl.acm.org/">Chung-Hwan Lim</author>
<author url="http://dl.acm.org/">Seog Park</author>
<author url="http://dl.acm.org/">Sang H. Son</author>
</authors>
XSLT
<div class="authors">
<xsl:for-each select="authors">
<a style="vertical-align:middle">
<xsl:attribute name="href">
<xsl:value-of select="@url"/>
</xsl:attribute>
<xsl:value-of select="."/>
</a>
</xsl:for-each>
</div>
O/P
<div class="authors"><a style="vertical-align:middle" href="">
Chung-Hwan Lim
Seog Park
Sang H. Son
</a></div>
The problem is I'm expecting three <a> tags but I'm only getting one. Why is that? why doesn't the `xsl:for-each' loop inner elements? How can I fix this?
No comments:
Post a Comment