GNOME Bugzilla – Bug 87901
Image processing error
Last modified: 2009-08-15 18:40:50 UTC
Version info: Using libxml 20423, libxslt 10019 and libexslt 710 xsltproc was compiled agains libxml 20423, libxslt 10019 and libexslt 710 libxslt 10019 was compiled against libxml 20423 libexslt 710 was compiled against libxml 20423 Using xsl-stylesheets 1.52.2 If I try to process the following simple file: <?xml version="1.0"?> <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"> <article> <sect1><title>Error Prone</title> <figure><title>The Fox Fur Nebula</title> <mediaobject> <imageobject> <imagedata fileref='foxfurnebula.ps' format='EPS'/> </imageobject> <imageobject> <imagedata fileref='foxfurnebula.jpg' format='JPG'/> </imageobject> <imageobject> <imagedata fileref='foxfurnebula.png' format='PNG'/> </imageobject> </mediaobject> </figure> </sect1> </article> with the command sequence: xsltproc file:///c:/docbook/docbook-xsl-1.52.2/fo/docbook.xsl test.xml > test.fo I get the following error: Error Undefined namespace prefix xmlXPathCompiledEval: evaluation failed When the resulting test.fo file is parsed with pdfxmltex passivetex produces many errors, these have been included in the form of an attachment with a few other files: test.xml -- The problem xml file test.fo -- The problem output test.log -- The problem log (from passivetex) NOTE:[The same error occurs if one tries to use html or xhtml output] Regards AM
Created attachment 9793 [details] the problem XML file
Created attachment 9794 [details] The problem fo output
Created attachment 9795 [details] The log of the problem generated by passivetex
Created attachment 9796 [details] The eps image for the document
Created attachment 9797 [details] The jpeg image for the document
Created attachment 9798 [details] The png image for the document
The version of pdfTex is Version 3.14159-1.00b-pretest-200020211 (Web2c 7.3.7x)
The problem is caused by the following piece of xslt in the file html/graphics.xsl in the docbook-xsl-1.52.2 package: <xsl:template match="imageobject"> <xsl:choose> <xsl:when xmlns:svg="http://www.w3.org/2000/svg" test="svg:*"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="imagedata"/> </xsl:otherwise> </xsl:choose> </xsl:template> The problem lies with the svg namespace declaration in the when element. Apparently the declaration is not read by xsltproc before the test expression is evaluated (or something along these lines in any case). It works if graphics.xsl is changed to: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink" ... xmlns:svg="http://www.w3.org/2000/svg" ... (i.e. the svg-namespace declared globally in graphics.xsl) and the imageobject template is written without the namespace declaration: <xsl:template match="imageobject"> <xsl:choose> <xsl:when test="svg:*"> <xsl:apply-templates/> ... I think it's a bug of xsltproc and not one of the stylesheets (but I'm not at all sure).
Yeah, it's a bug in libxslt, I don't know why the namespace declaration ain't propagated, this will require a serious debugging session ... when I have time... Daniel
Well I think I found it, I just sent a message to DocBook-Apps mailing list, this should be fixed in CVs with the following patch: http://cvs.gnome.org/bonsai/cvsquery.cgi?module=libxslt&branch=HEAD&branchtype=match&dir=libxslt&file=&filetype=match&who=veillard&whotype=match&sortby=Date&hours=&date=explicit&mindate=08%2F19%2F02+09%3A04&maxdate=08%2F19%2F02+09%3A06&cvsroot=%2Fcvs%2Fgnome As Peter Kullman correctly hinted it was an error in the namespace evaluation for the test on the <when> node :-\ Daniel
Okay, this should be fixed in the last releases, Daniel
I can confirm that this is fixed.
Nope. In docbook-style-xsl-1.65.1.2 (redhat 9 rpm) the error is still encountered and it goes away when a <inlinemediaobject> is commented out. xsltproc version: libxslt-1.0.19-1 (latest RPM availible for redhat 8). The xmlns:svg line at the beginning of the file is missing. Adding it does notfix the problem. Commenting out the inlinemdiaobject and just putting the imagedata by itself makes the error go away. This is a serious error because it doesn't give any indication of where the problem is. (Contained within <section> <inlinemediaobject> <imageobject> <imagedata fileref="diagram1.png"/> </imageobject> <textobject> <phrase>[PCB Footprint Flow Diagram]</phrase> </textobject> <caption> PCB Footprint overview diagram </caption> </inlinemediaobject> Oddly, before I logged in bugzilla gave me the option of reopening the bug but now it does not. Can someone reopen the bug?