[xslt] xsltproc - infinite recursion in docbook - when using profilingstylesheet



Greetings,

When I use the profile-docbook.xsl stylesheet in docbook, it generates fatal errors.

I filed a bugzilla report as #100271

Bug information pasted below:

                 > When I use the following command:
                 > 
                 > xsltproc  \
                 >   --catalogs \
                 >   --nonet \
                 >   --xinclude \
                 >   --output ./html/${1}.html \
                 >   --stringparam profile.condition FullRel \
                 >  file:///usr/share/sgml/docbook/xsl-stylesheets/html/profile-docbook.xsl
                 > \
                 >   ${1}.xml   
                 > 
                 > on the following file:
                 > 
                 > <?xml version='1.0' encoding='utf-8' ?>
                 > <!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.2//EN'
                 >                         
                 > 'http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd' >
                 > 
                 > <article>
                 >   <title>Title</title>
                 >   <section condition="FullRel">
                 >     <title>FullRel</title>
                 >     <para>FullRel para</para>
                 >   </section>
                 >   <section condition="UpdateRel">
                 >     <title>UpdateRel</title>
                 >     <para>UpdateRel para</para>
                 >   </section>
                 > </article>
                 > 
                 > I get the following output:
                 > 
                 > runtime error: file
                 > file:///usr/share/sgml/docbook/xsl-stylesheets/html/profile-docbook.xsl
                 > line 219 element apply-templates
                 > xsltApplyOneTemplate: loop found ???
                 > try increasing xsltMaxDepth (--maxdepth)
                 > Templates:
                 > #0 name * name head.keywords.content 
                 > #1 name * name head.keywords.content 
                 > #2 name * name head.keywords.content 
                 > #3 name * name head.keywords.content 
                 > #4 name * name head.keywords.content 
                 > #5 name * name head.keywords.content 
                 > #6 name * name head.keywords.content 
                 > #7 name * name head.keywords.content 
                 > #8 name * name head.keywords.content 
                 > #9 name * name head.keywords.content 
                 > #10 name * name head.keywords.content 
                 > #11 name * name head.keywords.content 
                 > #12 name * name head.keywords.content 
                 > #13 name * name head.keywords.content 
                 > #14 name * name head.keywords.content 
                 > Variables:
                 > 
                 > Using the following versions:
                 > LIBXML2 2.4.23 (libxml2-2.4.23-1 from RedHat)
                 > LIBXSLT 1.0.19 (libxslt-1.0.19-1 from RedHat)
                 > DTD 4.2.1 (docbook-dtds-1.0.14 from RedHat)
                 > XSL Stylesheets 1.57.0 (docbook-style-xsl-1.57.0-2 from RedHat)
                 > 
                 > 
                 > I don't know if:
                 > a) I'm doing something wrong
                 > b) The stylesheets have a problem
                 > c) XSLTPROC has a problem

                 You aren't doing anything wrong.  But you can work around
                 it by setting the stylesheet parameter inherit.keywords to
                 zero.

                 I think it is a bug in xsltproc.
                 The problem is that in the template named
                 "head.keywords.content", there is a recursive
                 call to the same template.

                   <xsl:if test="$inherit.keywords != 0 and parent::*">
                     <xsl:apply-templates select="parent::*" mode="head.keywords.content"/>
                   </xsl:if>

                 In profile-docbook.xsl, this recursive template goes into
                 an infinite loop.  The same template is in docbook.xsl, and
                 it does not go into an infinite loop.  Nor does Saxon go
                 into an infinite loop when processing with
                 profile-docbook.xsl.

                 The loop should stop when it reaches the root node.
                 xsltproc keeps going with <article>, somehow thinking
                 the parent of article is article.

                 Since this doesn't occur with the same template in
                 docbook.xsl, it would appear that the difference is that
                 profile-docbook.xsl is operating on a exslt nodeset. But I
                 can't explain it any further than that.

                 Bob Stayton                                 400 Encinal Street
                 Publications Architect                      Santa Cruz, CA  95060
                 Technical Publications                      voice: (831) 427-7796
                 The SCO Group                               fax:   (831) 429-1887
                                                             email: bobs@sco.com


Thanks.

John




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