|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: position() problem with // axis + parent numbering probl
> I expected the following to produce mutually exclusive sets whose union
> includes all <text> nodes in the input document.
so would I. (and that's what I got when I tried it)
given
<a>
<text>a</text>
<b>
<text>b</text><text>c</text><text>d</text>
<b>
<text>e</text><text>f</text>
</b>
</b>
<text>g</text>
</a>
xt and xalan give
==================================
abe
==================================
cdfg
==================================
==================================
a
==================================
bcdefg
==================================
from the stylesheet below, in each case [1] and not(position()=1)
give mutually exclusive sets of nodes.
David
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
==================================
<xsl:apply-templates select="//text[1]" />
==================================
<xsl:apply-templates select="//text[not(position() = 1)]" />
==================================
==================================
<xsl:apply-templates select="(//text)[1]" />
==================================
<xsl:apply-templates select="(//text)[not(position() = 1)]" />
==================================
</xsl:template>
</xsl:stylesheet>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








