Altova Mailing List Archives


Re: position() problem with // axis + parent numbering problem

From: David Carlisle <davidc@--------->
To:
Date: 4/18/2000 11:02:00 AM
> 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

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.