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: resolving variables out of context?


> <xsl:if test="@to">
> <xsl:variable name="toID" select="concat('B.', ../@src, '.',
> substring-before(substring-after(@to, 'ID('), ')'))"/>
> </xsl:if>
>
> Is the $toID limited to use *only* within the <xsl:if>?

yes.

>  Is
> there any way to declare it so that it can be used anywhere
> within the <xsl:template match="//xptr"> as a whole?
>
Try:

<xsl:variable name="toID">
   <xsl:if test="@to"><xsl:value-of select="concat('B.', ../@src, '.',
      substring-before(substring-after(@to, 'ID('), ')'))"/>
   </xsl:if>
</xsl:variable>

It's now a result tree fragment rather than a string, but you can use an RTF
to all intents and purposes as it it were a string.

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]