This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: xsl fo conversion pb with customization layer.
- To: bobs at caldera dot com, docbook-apps at lists dot oasis-open dot org, mpaindav at toad dot net
- Subject: Re: DOCBOOK-APPS: xsl fo conversion pb with customization layer.
- From: Bob Stayton <bobs at caldera dot com>
- Date: Mon, 10 Sep 2001 10:37:37 -0700 (PDT)
- List-Id: <docbook-apps.lists.oasis-open.org>
Correcting my own mistake, see below.
> From bobs Mon Sep 10 01:41:16 2001
>
> > From: Matthieu Paindavoine <mpaindav@toad.net>
> >
> > I found a file that redefines the behavior of variablelist, and I would
> > like to use it as part of a customization layer. alas, I am not so
> > successful, and I would be glad if someone could provide some pointers.
> >
> > I have my main xsl document: matt.xsl
> >
> >
> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > xmlns:fo="http://www.w3.org/1999/XSL/Format"
> > extension-element-prefixes="fo"
> > version="1.0">
> >
> > <xsl:import href="docbook.xsl"/>
> > <xsl:include href="variablelist.xsl"/>
> >
> > </xsl:stylesheet>
> >
> >
> > which calls: variablelist.xsl
> >
> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > xmlns:fo="http://www.w3.org/1999/XSL/Format"
> > version="1.0">
> >
> > <xsl:template match="variablelist">
> > <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
> > <xsl:apply-templates name="variablelist"/>
> > </xsl:template>
> >
> > <xsl:template match="varlistentry">
> > <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
> > <fo:block xsl:use-attribute-sets="list.item.spacing">
> > <xsl:apply-templates/>
> > </fo:block>
> > </xsl:template>
> >
> > <xsl:template match="varlistentry/term">
> > <fo:inline><xsl:apply-templates/>, </fo:inline>
> > </xsl:template>
> >
> > <xsl:template match="varlistentry/term[position()=last()]" priority="2">
> > <fo:inline>
> > <xsl:apply-templates/></fo:inline>
> > </xsl:template>
> >
> > <xsl:template match="varlistentry/listitem">
> > <fo:block start-indent="{count(ancestor::*)*.05}in">
> > <xsl:apply-templates/></fo:block>
> > </xsl:template>
> >
> > </xsl:stylesheet>
> >
> >
> > When running this through the fop blender, I get the following:
> >
> > /usr/bin/xsltproc /home/matt/docbook-xsl-1.44/fo/matt.xsl main.xml > main.fo
> > Making portrait pages on USletter paper (8.5inx11in)
> > xsltApplyOneTemplate: failed to find extension block
> > xsltApplyOneTemplate: failed to find extension block
> > xsltApplyOneTemplate: failed to find extension block
> > xsltApplyOneTemplate: failed to find extension block
> > /usr/lib/j2sdk1.3/bin/java -classpath /home/matt/test/classes.zip:/home/matt/test/xerces.jar:/home/matt/test/xalan.jar:/home/matt/test/batik-1.0/batik.jar:/home/matt/test/batik-1.0/batik-svgbrowser.jar:/home/matt/test/batik-1.0/batik-svgpp.jar:/home/matt/test/fop.jar org.apache.fop.apps.Fop -fo main.fo -pdf main.pdf
> > security properties not found. using defaults.
> > FOP 0.19.0-CVS
> > using SAX parser org.apache.xerces.parsers.SAXParser
> > building formatting object tree
> > WARNING: property 'linefeed-treatment' ignored
> > setting up fonts
> > formatting FOs into areas
> > [1] [2]
> > rendering areas to PDF
> > writing out PDF
> >
> > Presumably the patch is correct, so it must be the way I apply that
> > customization... Could you please indicate what I did wrong?
> > I have tried different xsl processor (xalan and xslt) and they both
> > stumble on that pb. I have also noticed that the extension block error
> > is linked to the <fo:block> in the template varlistentry.
> >
> > It seems to me that the error is that by copying this chunk out of the
> > main xsl file, I loose some context information. But I don't know
> > exactly what it is.
>
> According to my reference book (Michael Kay's XSLT
> Programmer's Reference 2nd ed), the scope of
> extension-element-prefixes attribute is the stylesheet
> module, not the full stylesheet tree constructed by
> applying <xsl:include> and <xsl:import>. So I think
> the <xsl:stylesheet> element in variablelist.xsl
> needs to include:
>
> extension-element-prefixes="fo"
>
> That should clear up the "failed to find extension block"
> errors.
In fact, "fo" is not an extension-element-prefix at all, it
is a namespace for the literal result elements being
generated . So the right answer is to remove this
attribute from <xsl:stylesheet> in both of his
customization files. I should always test before
answering! 8)
bobs
Bob Stayton 400 Encinal Street
Publications Architect Santa Cruz, CA 95060
Technical Publications voice: (831) 427-7796
Caldera International, Inc. fax: (831) 429-1887
email: bobs@caldera.com
----------------------------------------------------------------
To subscribe or unsubscribe from this elist use the subscription
manager: <http://lists.oasis-open.org/ob/adm.pl>