[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: position() problem with // axis + parent numbering probl

Subject: RE: position() problem with // axis + parent numbering problem
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Tue, 18 Apr 2000 09:49:30 +0100
axis position ancestor
> 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.