This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Matching attributes that contain both &pos; and "


> >To prevent circularity. Consider:
> 
> ><xsl:variable name="preferred">
> >   <xsl:call-templates select="get-preferred"/>
> ></xsl:variable>
> 
> ><xsl:template name="get-preferred">
> >   <xsl:apply-templates select="//item" mode="get"/>
> ></xsl:template>
> 
> ><xsl:template match="item[$preferred]" mode="get">
> >   <xsl:value-of select="."/>
> ></xsl:template>
> 
> Forgive me, but I'm a bit confused - how is this circular?

To evaluate the variable, you need to find the template rule that matches a
particular item element, but you can't tell whether the rule matches until
you know the value of the variable.

Mike Kay 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]