Page 1 of 1

Prefix FO not bound

Posted: Wed Dec 23, 2009 7:03 am
by burbles
I'm trying to create a stylesheet for a simple processing instruction to add a line break within a <para>. I'm using Docbook 5 with oXygen version 11.1.
Here is part of the XML code with the new 'linebr' style:

Code: Select all

text text text.</para>
<para>Department of xx<?linebr?>May 2009</para>
</sect1>
</preface>
And here is my stylesheet 'linebreak.xsl':

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
<xsl:import href="file:///c:/Program Files/Oxygen XML Editor 11/frameworks/docbook/xsl/fo/docbook.xsl"/>
<xsl:template match="processing-instruction('linebr')">
<fo:block break-after="line" />
</xsl:template>
</xsl:stylesheet>
I'm getting a validation error of:
F [Saxon6.5.5] The prefix "fo" for element "fo:block" is not bound.

What am I missing?
Thanks.

Re: Prefix FO not bound

Posted: Wed Dec 23, 2009 11:50 am
by adrian
Hello,

You need to add the namespace prefix declaration for fo to the root element of the stylesheet:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">

Regards,
Adrian