Menu

#963 Xsl-ns, block d:comment, d:remark template does not match

closed-fixed
nobody
XSL (1066)
5
2007-12-21
2007-12-10
No

An error found in fo/inline.xsl in the namespaced stylesheets. When examining the problem, the similar error was found in html/inline.xsl.

When trying to generate pdf from a docbook with a block-level <remark>, on the stage fo->pdf I get the error message:

>[error] Element 'fo:inline' cannot be a child of 'fo:flow'. Only block-level elements are permitted in this context.

The error is caused by incorrect entity definition in fo/inline.xsl ($Id: inline.xsl 7440 2007-09-12 17:30:52Z mzjn $):

<!DOCTYPE xsl:stylesheet [
<!ENTITY comment.block.parents "parent::answer|parent::appendix|...

which is further used in the template:

<xsl:template match="d:comment[&comment.block.parents;]|d:remark[&comment.block.parents;]">

The namespace d: is missing. This should be:

<!DOCTYPE xsl:stylesheet [
<!ENTITY comment.block.parents "parent::d:answer|parent::d:appendix|...

The same error is in the html/inilne.xsl ($Id: inline.xsl 7232 2007-08-11 16:10:40Z mzjn $).

Though, in the xhtml/inline.xsl (This file was created automatically by html2xhtml from the HTML stylesheets.
$Id: inline.xsl 7232 2007-08-11 16:10:40Z mzjn $) all is correct. There are no entities, and the template definition looks like this:

<xsl:template match="d:comment[parent::d:answer|parent::d:appendix|...

It might be better not to use entities, but use the xhtml definition. Copying this line from xhtml/inline.xsl to fo/inline.xsl fixes the problem. The html/inline.xsl should also be fixed.

Found in docbook-xsl-ns 1.73.2, also in the snapshot revision 7580, on 2007-12-07 at 0105 PST.

Tools used:

C:\DocBook\libxslt>xsltproc.exe --version
Using libxml 20626CVS2823, libxslt 10117CVS1069 and libexslt 813CVS1069
xsltproc was compiled against libxml 20626, libxslt 10117 and libexslt 813
libxslt 10117 was compiled against libxml 20626
libexslt 813 was compiled against libxml 20626

xep-4.10-20070727-personal

Sample document:

<?xml version="1.0" encoding="UTF-8"?>
<article version="5.0"
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Test</title>
<remark>Remark</remark>
</article>

Discussion

  • Alexey Elizarov

    Alexey Elizarov - 2007-12-10
    • summary: Error in the ns stylesheets for block d:comment, d:remark --> Xsl-ns, block d:comment, d:remark template does not match
     
  • Mauritz Jeanson

    Mauritz Jeanson - 2007-12-12

    Logged In: YES
    user_id=582041
    Originator: NO

    There was a bug in the Perl script that converts non-namespaced stylesheets to namespaced stylesheets. The problematic entity is called comment.block.parents, but in the script it was assumed that entity names consist of alphanumeric characters only.

     
  • Mauritz Jeanson

    Mauritz Jeanson - 2007-12-12

    Logged In: YES
    user_id=582041
    Originator: NO

    A fix for this issue has been added to the current codebase.
    Please test the fix with the latest snapshot from:

    http://docbook.sourceforge.net/snapshots/

     
  • Mauritz Jeanson

    Mauritz Jeanson - 2007-12-12
    • status: open --> pending-fixed
     
  • Alexey Elizarov

    Alexey Elizarov - 2007-12-20

    Logged In: YES
    user_id=464574
    Originator: YES

    Tested: xsl-ns. In my case the xsl-ns version now creates correct output for all 3 targets: fo, html, xhtml. The version without namespace is not tested, though, I don't expect it to fail.

     
  • Alexey Elizarov

    Alexey Elizarov - 2007-12-20
    • status: pending-fixed --> open-fixed
     
  • Mauritz Jeanson

    Mauritz Jeanson - 2007-12-21
    • status: open-fixed --> closed-fixed