This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: FXPath v0.3 + SAXON Implementation
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: Re: [xsl] FXPath v0.3 + SAXON Implementation
- From: "David Rosenborg" <david dot rosenborg at pantor dot com>
- Date: Thu, 8 Mar 2001 14:32:38 +0100
- References: <9B66BBD37D5DD411B8CE00508B69700F4F03B5@pborolocal.rnib.org.uk>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Dave,
> I'm *guessing* that the function evaluates to the application
> of the expression to the node value.
> If the 'expression' is something like contains(.,'P')
> is it possible to apply that expression within the moded template?
> Or am I wrong again?
Function application is not so dynamic in XPath/FXPath.
You cannot convert the $expr string into an expression which gets evaluated. You would
have to test for the string value of $expr value as in
<xsl:template match="*" mode="com:eval">
<xsl:choose>
<xsl:when test="$expr = '.'">
<xsl:value-of select="."/>
</xsl:when>
<xsl:when test="starts-with ($expr, 'contains (.,')">
<xsl:if test='contains (., substring-before (substring-after ($expr, "'"), "'"))'>true</xsl:if>
</xsl:when>
...
</xsl:template>
This isn't particulary dynamic or scalable, but I believe this is the intended use of $expr in com:eval.
Cheers,
</David>
David Rosenborg
Pantor Engineering AB
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list