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

Re: Self index?

Subject: Re: Self index?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 11 Apr 2003 13:38:31 +0100
lkhlg
  And I didn't have a template match on h3 (yet another duh!).
  I was trying to process it from the stylesheet end?

Of course we're still working with zero information on what your
stylesheet looks like but yes I suppose that you were generating your
headers with literal result elements in the stylesheet and the toc
by re-processing the stylesheet as a source with document('')
these two instances of the stylesheet are treated as different documents
by saxon so you won't get the same ids. You don't even get the same
input trees necessarily as the white space stripping will be different
unless you are very careful to set things up with xsl:strip space.
When read as a stylesheet there is no text node as a child of
xsl:template in
<xsl:template match="x"?
  <xsl:value-of select="."/>
</xsl:template>
but if you read the stylesheet with document('') as a source document
then by default that element has two text child nodes, one with a
newline and two spaces, and one with just a newline.

So if you want to use generate-id you have to use document('') on both
ends of the link, or since you are using xslt2 and don't need to mess
with node-set() you can put all your <h3 elemnts into a variable
<xsl:variable name="x">
 <h3>lkhlg</h3>
 lkhlk
...
</xsl:variable>

then you process apply templates once to $x to output the headers,
adding an id with generate-id and apply templates in a different node
to make the toc.

this is the same as the document('') case except using the variable as a
temporary document instead of re-parsing the stylesheet. You can do same
in xslt1 if you use a node-set() extension.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 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.