[xslt] Very weird problem



Hi,

I believe I have found a problem that is a good candidate for the price
of the 'Weirdest Gnome XSLT feature seen in 2004' ... ;-)

I am using
 > xsltproc --version
Using libxml 20423, libxslt 10019 and libexslt 710
xsltproc was compiled against libxml 20423, libxslt 10019 and libexslt 710
libxslt 10019 was compiled against libxml 20423
libexslt 710 was compiled against libxml 20423

and try to process a ~500K XML file with a fairly simple structure

<?xml version="1.0"?>
<Root>
  <Parameter ...>
  ...
      <Parameter>
      ...
      </Parameter>
  ...
  </Parameter>
  ...
</Root>

using a stylesheet with the coarse structure:

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

     <xsl:output method="text"/>

     <xsl:template match="/Root">
         <xsl:apply-templates/>
     </xsl:template>

     <xsl:template match="Parameter">
     ...
     </xsl:template>

</xsl:stylesheet>

With xsltproc this takes a little over 1 minute to run to completion and
the output is ok. So far so good but I have another stylesheet that
generates a slightly different (HTML) output using the same input file
in less than 2s!!

After a lot of experimenting and comparison I found that I can also
get the above to run in about 2s (producing the right output) if I include
the statement

  <xsl:text disable-output-escaping="yes"> </xsl:text>

in the "Parameter" template. It actually does not matter where I place it
exactly in the template or the text that is being output as long as it is
not empty, i.e. with

   <xsl:text disable-output-escaping="yes"></xsl:text>

I get back the old runtime of ~1min. Also if I remove
disable-output-escaping="yes" (<xsl:text> </xsl:text>) it runs slowly.

Does anybody have a clue what is going on here?

Thanks
Uwe




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