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

RE: navigation, TEI

Subject: RE: navigation, TEI
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 23 Jun 2004 11:18:06 -0400
RE:  navigation
This provides a good example of why it's so much nicer and easier, when working with TEI and XSLT, to use unnumbered divs instead of the div0...div9 stuff. Numbered divs can be preprocessed into unnumbered divs easily enough, and all these nasty XPath expressions boil down to preceding-sibling::div etc.

Cheers,
Wendell

At 02:22 AM 6/23/2004, Jarno wrote:
> I'm working on extending the TEI xsl stylesheet set with a more
> complex 'prev-next' navigation bar. For the linking i need two
> parameters: the text of the link, and the id of the link.
> I use a template to get the appropriate node:
>
> <xsl:template name="getPrev">
>   <xsl:variable name="nodeSet">
>     <xsl:text>self::div0 | self::div1 | self::div2 |
> self::div3 | self::div4</xsl:text>
>   </xsl:variable>

Here you're binding $nodeSet to a Result Tree Fragment and?

>   <xssl:choose>
>     <xsl:when test="(preceding-sibling::*[$nodeSet]/head)[last()]">

? here if will always returnn true...
...
How about

<xsl:template name="getPrevID">
<xsl:choose>
<!--here you don't need to test for the last, because it will be true even if you have just one div# head -->
<xsl:when test="preceding-sibling::*[self::div0 | self::div1 | self::div2 | self::div3 | self::div4]/head">
<xsl:value-of select="generate-id(preceding::*[self::div0 | self::div1 | self::div2 | self::div3 | self::div4]/head[last()])" />
</xsl:when>
<xsl:when test="ancestor::*[self::div0 | self::div1 | self::div2 | self::div3 | self::div4]/head">
<xsl:value-of select="generate-id(ancestor::*[self::div0 | self::div1 | self::div2 | self::div3 | self::div4]/head[last()])" />
</xsl:when>
</xsl:choose>
</xsl:template>


======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


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.