This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
XPath selection using //
- From: "Filipe Correia" <filipe dot correia at paradigmaxis dot pt>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Wed, 17 Jul 2002 15:11:06 +0100
- Subject: [xsl] XPath selection using //
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi,
Here's a tree wich is a part of my xml document:
<b>
<m a="attribute">
text text text
<t>
<r>
<d>more text</d>
<r/>
</t>
</m>
<t>
<r>
<d/>
<d><m a="attribute">text</m></d>
<r/>
</t>
<m/>
text
</b>
what I want to do is to evaluate only the
contents of the "m" elements. For each "m"
element I also need to output the next "m"'s
"a" atribute.
Everything else should be ignored.
In the stylesheet that I use I'm applying the
respective templates like this:
...
<xsl:apply-templates select="b//m"/>
...
using the following template to apply
templates to all descendants of the
current "m" node and to get the next "m"'s
"a" atribute:
<xsl:template match="m">
<xsl:apply-templates/>
Atribute a of the following m is:
<xsl:value-of select="ancestor::*[parent::b]/following-sibling::node()//m/@a"/>
</xsl:template>
but getting the next "m"'s "a" atribute is
not working as I expected...
Any idea on what I may be doing wrong?
Thanks in advance,
Filipe
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list