This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: [docbook-apps] Infinite loop in xsl processing
- From: Bob Stayton <bobs at sco dot com>
- To: "Sanders, M." <MSA at ballastham dot com>
- Cc: DOCBOOK-APPS <docbook-apps at lists dot oasis-open dot org>
- Date: Mon, 17 Nov 2003 08:31:45 -0800
- Subject: Re: [docbook-apps] Infinite loop in xsl processing
- References: <2C638A837F8C18499710D0E61D2604D9EFD7F1@ZIRCONIUM.ballastham.com>
On Mon, Nov 17, 2003 at 01:57:04PM +0100, Sanders, M. wrote:
> Hi,
>
> I am using modular documents with xi:include.
>
> When I include a sect1 document, a part of a modular chapter, xsltproc
> works fine with my own xsl customization file (only param's). When I
> process the file as a stand alone document with the same customization
> file xsltproc and stylesheets (1.62.4) go in an infinite loop. The top
> of the loop looks like:
>
> runtime error: file ..../common/common.xsl line 132 element text
> xsltApplyOneTemplate: Loop found ???
> try increasing xsltMaxDepth (--maxdepth)
> Templates:
> #0 name is.component
> #1 name sect1 name label.markup
> #2 name sect1 name label.markup
> #3 name sect1 name label.markup
> #4 name sect1 name label.markup
> etc.
>
> If I remove the param section.label.includes.component.label '1' from
> the customization everything works fine. Is this a bug, a feature or am
> I doing something wrong?
It's a bug. I just checked in a fix in common/labels.xsl.
Until the next stylesheet release, you can put this
fixed version of the template in your customization:
<xsl:template match="sect1" mode="label.markup">
<!-- if the parent is a component, maybe label that too -->
<xsl:variable name="parent.is.component">
<xsl:call-template name="is.component">
<xsl:with-param name="node" select=".."/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="$section.label.includes.component.label != 0
and $parent.is.component != 0">
<xsl:variable name="parent.label">
<xsl:apply-templates select=".." mode="label.markup"/>
</xsl:variable>
<xsl:if test="$parent.label != ''">
<xsl:apply-templates select=".." mode="label.markup"/>
<xsl:apply-templates select=".." mode="intralabel.punctuation"/>
</xsl:if>
</xsl:if>
<xsl:choose>
<xsl:when test="@label">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:when test="$section.autolabel != 0">
<xsl:number count="sect1"/>
</xsl:when>
</xsl:choose>
</xsl:template>
--
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
To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.