Re: Need help with count expression
I need a bit of help with count() as so far I've been unable to construct a valid expression to obtain what I need Basically what I'm trying to do is generate Table numbers relative to Chapters but only for tables that contain a title element. Here's an example structure
I think you should just use what you need along the lines of the following:
<xsl:number count="*[contains(@class,' topic/table ')] [*[contains(@class,' topic/title ')]]" from="chapter" level="any"/>
... instead of using count(). The from= limits the count to those items below the closest matching ancestor.
Note also that I'm counting tables qualified by their title ... in your code you were counting the table titles. Probably the same in this case, but semantically I'm counting tables in case that helps for maintenance and understanding.
I hope this helps.
. . . . . . . . . . . Ken
-- Upcoming XSLT/XSL-FO, UBL and code list hands-on training classes: : Sydney, AU 2009-01/02; Brussels, BE 2009-03; Prague, CZ 2009-03 Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
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