This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: xsl:value-of
- From: Oleg Tkachenko <olegt at multiconn dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Mon, 01 Jul 2002 16:03:39 +0200
- Subject: Re: [xsl] xsl:value-of
- Organization: Multiconn International Ltd
- References: <20020701124444.98319.qmail@web9401.mail.yahoo.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Cenk Uysal wrote:
I try to print same named tags one after another. my XML is just like
this:
<a>
<b at=""></b>
<b at=""></b>
<b at=""></b>
</a>
I also have to control attributes of them. If they are valid, I will
print them on screen.
Here is the part of XSL:
<xsl:for-each select="b[@at=$something]">
<xsl:value-of select="../b"/>
</xsl:for-each>
But this time XSL prints first element all the time repeatedly. What
can be the solution?
<xsl:value-of select="../b"/> stands for "output string value of the first
node in ../b node-set". ../b xpath expression means "all b children of the
current node's parent", so <xsl:value-of select="../b"/> will always output
string value of the first b element. If you want to output current element
value, use <xsl:value-of select="."/>
--
Oleg Tkachenko
Multiconn International Ltd, Israel
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list