mirror of
https://gitlab.gnome.org/GNOME/libxslt
synced 2025-09-14 05:09:26 +03:00
exsltFuncFunctionFunction handles XPath extension functions and is called from the XPath engine. Since evaluation of function templates can change the XPath context node, it must be backed up to avoid corruption. Without proper backup, evaluating certain content in function templates could also result in use-after-free errors. It seems that libxml2 commit 029d0e96 helped to expose the error. Fixes #11.
12 lines
430 B
XML
12 lines
430 B
XML
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:func="http://exslt.org/functions" version="1.0" extension-element-prefixes="func">
|
|
<func:function name="func:f">
|
|
<xsl:for-each select="namespace::*">
|
|
<xsl:sort/>
|
|
</xsl:for-each>
|
|
<func:result>10</func:result>
|
|
</func:function>
|
|
<xsl:template match="*">
|
|
<xsl:value-of select="func:f()+count(abc)"/>
|
|
</xsl:template>
|
|
</xsl:stylesheet>
|