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

RE: xsl:number counting "cousins"

Subject: RE: xsl:number counting "cousins"
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Mon, 7 Oct 2002 00:11:33 +0100
number counting
Doesn't 

<xsl:number level="any" from="table"/>

give you what you want?

The from attribute is a pattern, not an XPath expression, which explains
why you can't use the ancestor axis.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Gustaf Liljegren
> Sent: 06 October 2002 21:29
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  xsl:number counting "cousins"
> 
> 
> I have this source:
> 
> ...
> <colgroup>
>   <col/>
>   <col/>
>   <col/>
> </colgroup>
> <colgroup>
>   <col/>
> </colgroup>
> ...
> 
> And this template:
> 
> <xsl:template match="col">
>   <fo:table-column>
>     <xsl:attribute name="column-number">
>       <xsl:number count="col" from="ancestor::table//*"/>
>     </xsl:attribute>
>     ...
>   </fo:table-column>
> </xsl:template>
> 
> There's a fault here as you can see. The processor doesn't 
> like what I put in the 'from' attribute. It can only be 
> children, not "cousins", like here. Why this limitation? I 
> think the above is pretty much straightforward. :-)
> 
> If I write like in the example in XSL (no 'from' attribute), 
> I get problems like this:
> 
> <fo:table-column column-number="1" .../>
> <fo:table-column column-number="2" .../>
> <fo:table-column column-number="3" .../>
> <fo:table-column column-number="1" .../>
> 
> It starts over when it steps into the new group. What's the solution?
> 
> Gustaf
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 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.