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

Re: Feature Request - Node Set Processing (long)

Subject: Re: Feature Request - Node Set Processing (long)
From: James Clark <jjc@xxxxxxxxxx>
Date: Sat, 16 Jan 1999 16:13:05 +0700
right arrow gif
"G. Ken Holman" wrote:

> Does this explanation make more sense than my first explanation?

Not really.  You are explaining your proposed solution to a
transformation problem, without really explaining the transformation
problem itself. What does your source tree look like, and what is the
result tree you are trying to get from it? Without knowing this, it is
not possible to evaluate your proposed solution and to consider
alternative solutions.

For example, when I see:

   <xsl:choose select="/course/intro|
                       /course/lesson|
                       /course/exit"
               test="next">
     <xsl:when>
       <a href="{@id}.htm"><img src="active-right-arrow.gif"/></a>
     </xsl:when>
     <xsl:otherwise>
       <img src="inactive-right-arrow.gif"/>
     </xsl:otherwise>
   </xsl:choose>

I don't understand why you can't just use:

   <xsl:choose>
     <xsl:when test="next-element()">
       <a href="{next-element()/@id}.htm"><img
src="active-right-arrow.gif"/></a>
     </xsl:when>
     <xsl:otherwise>
       <img src="inactive-right-arrow.gif"/>
     </xsl:otherwise>
   </xsl:choose>

If the problem is that you want to skip certain siblings, then you can
do:

 <xsl:invoke macro="forward-link"/>

...

<xsl:template match="intro|lesson|exit" mode="forward-link">
    <a href="{@id}.htm"><img src="active-right-arrow.gif"/></a>
</xsl:template>

<xsl:template match=*" priority="-1" mode="forward-link">
  <xsl:invoke macro="forward-link"/>
</xsl:template>

<xsl:macro name="forward-link">
  <xsl:choose>
     <xsl:when test="next-element()">
       <xsl:apply-templates select="next-element()"
mode="forward-link"/>
        </xsl:when>
     <xsl:otherwise>
       <img src="inactive-right-arrow.gif"/>
     </xsl:otherwise>
   </xsl:choose>
</xsl:macro>

James


 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.