This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Question about Context Changes in XSLT Questions and Answers for David Carlisle
- To: xsl-list at lists dot mulberrytech dot com
- Subject: [xsl] Question about Context Changes in XSLT Questions and Answers for David Carlisle
- From: "Yao, Mingdong" <Mingdong dot Yao at Bestbuy dot com>
- Date: Thu, 4 Jan 2001 12:22:59 -0600
- Reply-To: xsl-list at lists dot mulberrytech dot com
When I tested the XPath:A/C[postion()=2] and A/*[position()=2 and self::C],
they gave me the same results. So are they the same or not? Thanks
XML:
<?xml version="1.0" standalone="yes"?>
<a>
<c>c1<d>d11</d><d>d12</d>
<d>d13</d><d>d14</d></c>
<c>c2<d>d21</d><d>d22</d>
<d>d23</d><d>d24</d></c>
<c>c3</c>
<c>c4</c>
</a>
XSL:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="a/*[position()=2 and self::c]">
<td>(<xsl:value-of select="."/>)</td>
</xsl:template>
</xsl:stylesheet>
Mingdong (Don) Yao
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list