I'm trying to create a custom processing instruction to insert and format a background image in a chapter abstract. I've followed the instructions in Chapter 9 of DocBook XSL TDG but am getting error messages about empty parameters.

The XML is:

<abstract>
<?dbfo bgimage="images/Box5-4.gif"?>
<?dbfo bgposition="50% 30%"?>
<?dbfo bgwidth="170mm"?>
<title>Chapter 1 overview</title>
<para>The text in ... </para>
</abstract>
</info>

(I'd like to combine all three params into one pi if possible.)

I've set up variables for background-image, content-width and position:

<xsl:templatematch="d:abstract"mode="chapter.titlepage.recto.auto.mode">
<xsl:variablename="bgimage">
<xsl:call-templatename="dbfo-attribute">
<xsl:with-paramname="pis"
select="ancestor-or-self::d:abstract/processing-instruction('dbfo')"/>
<xsl:with-paramname="attribute"select="'background-image'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variablename="bgwidth">
<xsl:call-templatename="dbfo-attribute">
<xsl:with-paramname="pis"
select="ancestor-or-self::d:abstract/processing-instruction('dbfo')"/>
<xsl:with-paramname="attribute"select="'ex:background-content-width'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variablename="bgposition">
<xsl:call-templatename="dbfo-attribute">
<xsl:with-paramname="pis"
select="ancestor-or-self::d:abstract/processing-instruction('dbfo')"/>
<xsl:with-paramname="attribute"select="'background-position'"/>
</xsl:call-template>
</xsl:variable>

<fo:blockxmlns:fo="http://www.w3.org/1999/XSL/Format";
xmlns:ex="http://www.renderx.com/XSL/Extensions";
xsl:use-attribute-sets="chapsummaryprops"
background-image="{$bgimage}"
ex:background-content-width="{$bgwidth}"
background-position="{$bgposition}">
<xsl:apply-templatesselect="d:title"/>
<xsl:apply-templatesselect="d:para"/>
<!--<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>-->
</fo:block>
</xsl:template>

And when I process it with Saxon 6.5.5 the error messages are:

[warning] Attribute 'background-image' cannot have a value of "": should be either 'inherit' or a URI: background-image="url(...)".
[error] Attribute 'rx:background-content-width' cannot have a value of "".

I'm using DB 1.77.1, XEP 4.19.

Thanks

--
*Dave Gardiner*

Reply via email to