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

Re: how do indirection in value-of or select?

Subject: Re: how do indirection in value-of or select?
From: Michael Koehrsen <koehrsen@xxxxxxxxx>
Date: Sat, 27 Feb 1999 09:02:09 -0500
michael k hrsen

> 
> I would like to be able to say:
> 
>     <xsl:template match="/a/blist/b">
>         <xsl:apply-templates select="name"/>
>         <xsl:apply-templates select='/a/clist/c[d=@n]'/>
>     </xsl:template>
> 

You're implicitly assuming that the @n is going to be resolved against
the node matched by the containing template, rather than the node being
tested by the select pattern.  This strikes me as kind of an ad-hoc
extension to existing pattern semantics.  I think this example leads
back to the general problem of needing to be able to store some local
state in templates.  If we had local constants, for example, you could
do:

    <xsl:template match="/a/blist/b">
      <xsl:apply-templates select="name"/>
      <xsl:constant name="n" value="{@n}"/>
      <xsl:apply-templates select='/a/clist/c/[d=constant(n)]'/>
    </xsl:template>

This requires a change to pattern syntax, but the semantics are
straightforward and consistent.

MJK


 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.