[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Feature Request - Node Set Processing (long)
"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
|
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
|