Prefix FO not bound

Here should go questions about transforming XML with XSLT and FOP.
burbles
Posts: 37
Joined: Wed Dec 23, 2009 6:13 am

Prefix FO not bound

Post 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.
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: Prefix FO not bound

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply