[xslt] Extensions functions will modify the stylesheet at transformation-time



Hi,

Extension functions will modify the compiled-stylesheet at
transformation-time in certain scenarios.

Example:

<?xml version='1.0'?>
<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  xmlns:libxslt="http://xmlsoft.org/XSLT/";>

  <xsl:template match="/">
    <xsl:value-of select="libxslt:test('SUCCESS')"/>
  </xsl:template>

</xsl:stylesheet>

The above example will generate the following
callstack:

... -->
xmlXPathCompOpEval() -->
 xsltExtFunctionTest() -->
  xsltGetExtData() -->
   xsltExtInitTest() -->
    xsltStyleGetExtData():

xsltStyleGetExtData() will modify the stylesheet's @extInfos field:

  1) style->extInfos = xmlHashCreate(10);
  2) if (xmlHashAddEntry(style->extInfos, URI, (void *) data) < 0)

I think this could lead to race conditions in multithreaded
scenarios using precompiled stylesheets.
We need to change this somehow to avoid modifying the stylesheet
at transformation-time.

Does anyone know if this is a known issue? Is someone into
that part of code?

Regards,

Kasimier


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]