xsl-list
[Top] [All Lists]

RE: TOC despair

2003-12-03 17:50:08
Oops, your right, that would convert each node to a string before
comparing. I use this test in some of my stylesheets, but each node has
a unique id and I compare these ids. What you should do if you don't
have unique ids is to use:

<xsl:if test="generate-id(.) =
generate-id(ancestor::chapter[1]//section[position()=last())]">

Of course, if you are transforming to fo or html, I would use style
attributes to indicate the extra space. There are multiple ways to
specify this kind of style. If you are transforming to plain text, then
I would recommend the above or using apply-templates with a
with-parameter modifier for the last section. The apply-templates is a
bit wordy, but very efficient.


John Meyer
Senior Software Engineer
Clinician Support Technology
1 Wells Avenue, Suite 201
Newton, MA 02459
www.cstlink.com

-----Original Message-----
From: David Carlisle [mailto:davidc(_at_)nag(_dot_)co(_dot_)uk] 
Sent: Wednesday, December 03, 2003 7:28 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] TOC despair


<xsl:if test=". = ancestor::chapter[1]//section[position()=last()]">
That would cause the string values (ie the concatenation of all
characters in each section) to be compared..

-- 
http://www.dcarlisle.demon.co.uk/matthew

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>