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

RE: Determining last node

Subject: RE: Determining last node
From: "Larry Garfield" <lgarfiel@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 14 Aug 2001 16:19:57 -0500
sibling last node
> -----Original Message-----

> Send button pressed too early: add "[1]" after all *::chapter.
> Also another minor syntax error fixed:

<snip>

> Still untested.

Xalan complained about $chNum-1 not being a variable, but once I put a space
after the 'm' it worked perfectly.  Thanks!  I guess I'm still having a hard
time thinking in terms of a node as a variable, and figuring out when it is
and is not split off from the rest of its siblings/parents by what
processing tags.

> Further notes: If you aim for purity, replace the chNum parameter
> by count(chapter::preceding::chapter)+1, this may degrade performance,
> however.

If it works and is specification-compliant code, that's pure enough for me.
:-)  I'll save that for future reference, however.  How much of a
performance difference is there between that and passing $chNum through
every template to get to that point?

> If your chapters are actually all siblings (as they are in the DocBook
> DTD) and not nested somewhere else, replacing preceding::chapter by
> preceding-sibling may increase performance a bit. Assigning
> $chapter/preceding::chapter[1] etc. to a variable might help improving
> performance for processors which are bad at CSE.

The chapters are all siblings (I'm using DocBook for the input file), but
the sect1s are not, so I decided to stick with the same code for both
sections (slightly modified, of course).  It's only being run offline, so
finely tuned performance isn't a huge issue.

Thanks again!

--Larry Garfield


 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.