1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-08-08 21:42:07 +03:00
Files
libxslt/tests/general/bug-212.xsl
Nick Wellnhofer 5e16672db1 Move function result RVTs to context variable
If a variable with a "select" expression calls an EXSLT func:function,
the context variable must be restored before evaluating the function
result. This makes sure that the RVTs in the result will be moved to
the context variable's fragment list when they're released in
xsltReleaseLocalRVTs or xsltReleaseLocalRVTs.

Thanks to Nikolai Weibull for the report.
2018-09-26 23:20:48 +02:00

26 lines
679 B
XML

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:func="http://exslt.org/functions"
xmlns:a="a"
extension-element-prefixes="func">
<xsl:output method="text" encoding="UTF-8"/>
<func:function name="a:a">
<func:result>
<xsl:apply-templates mode="a"/>
</func:result>
</func:function>
<xsl:template mode="a" match="node()">
<xsl:text>a</xsl:text>
</xsl:template>
<xsl:template match="/">
<xsl:variable name="a" select="a:a()"/>
<xsl:value-of select="$a"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="$a"/>
<xsl:text>&#x0a;</xsl:text>
</xsl:template>
</xsl:stylesheet>