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

Better way to change context?

Subject: Better way to change context?
From: JBryant@xxxxxxxxx
Date: Thu, 14 Oct 2004 10:34:58 -0500
change context
Hi, all,

In the course of creating an HTML version of a stylesheet (I was doing 
just PDF before), I split the content into several files (one for each 
chapter). Consequently, I needed to prepend the chapter name to the anchor 
value. With some functions, that was easy enough.

However, something bugs me. I used xsl:for-each to force the context to 
the node pointed to by the cross-reference. It seems a little silly to use 
a for-each statement to do that. I bet there are other (and perhaps 
better) ways to set the context for this operation.

Basically, I am curious to see how you folks would solve the same problem, 
so that I might learn something.

Here's the relevant code snippet:

    <xsl:variable name="thisChapter">
      <xsl:for-each select="key('refentries', .)">
        chapter<xsl:value-of 
select="substring-before(substring-after(saxon:path(), 'chapter['), 
']')"/>.html#
      </xsl:for-each>
    </xsl:variable>

As an aside, thanks to Michael Kay. I love Saxon.

Jay Bryant
Bryant Communication Services

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.