[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Better way to 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
|
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
|