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

Re: navigation, TEI

Subject: Re: navigation, TEI
From: "kirunews" <kirunews@xxxxxxxxxxx>
Date: Wed, 23 Jun 2004 23:11:40 +0200
kiraly peter
Thanks for the answers! At the moment, the solution i found:

step 1. - indexing the generated ids of the div/head
<xsl:key name="divs" 
         match="//*[substring-after(name(),'div') &lt; 5]/head"
         use="generate-id()" />

(one problem here: i couldn't use variable here, so
  match="//*[ substring-after(name(),'div') &lt; $oneNumber ]/head"
doesn't work.)

step 2. - get the generated ids instead of fragment trees
          and
          using the general $splitLevel variable instead of listing each div levels
          (in one hand it's more slower than i expected but in the other
          hand it uses a very useful parameter...)

<xsl:when test="preceding-sibling::*[substring-after(name(),'div')&lt;$splitLevel]/head">
  <xsl:value-of select="generate-id( (preceding::*[substring-after(name(),'div')&lt;$splitLevel]/head)[last()] )" />
</xsl:when>

step 3. - 'dereferencing' [it's a kind of Perl-ish expression] the id
 with the 'key' function (eliminating the problems came from fragment
 trees) instead of the very-very slow '//node()[generate-id()=$generatedID]'
 expression

<xsl:apply-templates select="key('divs', $prev)/self::*" />

The life and XSL are great! (and so hard as well)

All the best!

Kiraly Peter
http://www.arcanum.hu
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.