Re: [xslt] Very weird problem



On Thu, Jan 29, 2004 at 02:39:26PM +0100, Uwe Lammers wrote:
> 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?

  Hum, it must be related to nodes being merged repeteadly instead of
using a buffer. Bugzilla this, agreed it's weird :-)

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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