[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. > > <xsl:apply-templates select="//text[1]" /> > <xsl:apply-templates select="//text[not(position() = 1)]" /> You are right to expect this! > > It appears this is not the case - I've tested this in Saxon > and Xalan, so I'm confident the implementors have it right - I just don't know why. Can you tell us *exactly* what you wrote? > > Two > --- > > I was trying to get the number of the parent node of the > current node taken across the entire document, and I can't see an easy way to do > it. > <xsl:variable name="parent_number"> > <xsl:for-each select="ancestor::grouping_element[1]"> > <xsl:number count="grouping_element" level="any" /> > </xsl:for-each> > </xsl:variable> > I think the <xsl:for-each> here is redundant. The <xsl:number> will give you the number of the first ancestor that matches the count pattern. Mike Kay 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
|