After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 87901 - Image processing error
Image processing error
Status: VERIFIED FIXED
Product: libxslt
Classification: Platform
Component: general
unspecified
Other Windows
: Normal critical
: ---
Assigned To: Daniel Veillard
Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2002-07-11 07:35 UTC by vnhu38f93
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the problem XML file (634 bytes, text/xml)
2002-07-11 07:38 UTC, vnhu38f93
Details
The problem fo output (33.24 KB, application/octet-stream)
2002-07-11 07:39 UTC, vnhu38f93
Details
The log of the problem generated by passivetex (55.67 KB, text/plain)
2002-07-11 07:40 UTC, vnhu38f93
Details
The eps image for the document (501.23 KB, image/eps)
2002-07-11 07:41 UTC, vnhu38f93
Details
The jpeg image for the document (27.05 KB, image/gif)
2002-07-11 07:42 UTC, vnhu38f93
Details
The png image for the document (199.17 KB, image/png)
2002-07-11 07:42 UTC, vnhu38f93
Details

Description vnhu38f93 2002-07-11 07:35:36 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
Comment 1 vnhu38f93 2002-07-11 07:38:34 UTC
Created attachment 9793 [details]
the problem XML file
Comment 2 vnhu38f93 2002-07-11 07:39:59 UTC
Created attachment 9794 [details]
The problem fo output
Comment 3 vnhu38f93 2002-07-11 07:40:43 UTC
Created attachment 9795 [details]
The log of the problem generated by passivetex
Comment 4 vnhu38f93 2002-07-11 07:41:50 UTC
Created attachment 9796 [details]
The eps image for the document
Comment 5 vnhu38f93 2002-07-11 07:42:14 UTC
Created attachment 9797 [details]
The jpeg image for the document
Comment 6 vnhu38f93 2002-07-11 07:42:40 UTC
Created attachment 9798 [details]
The png image for the document
Comment 7 vnhu38f93 2002-07-11 07:48:35 UTC
The version of pdfTex is Version 3.14159-1.00b-pretest-200020211 
(Web2c 7.3.7x)
Comment 8 Peter Kullmann 2002-07-18 14:14:30 UTC
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).
Comment 9 Daniel Veillard 2002-07-20 15:34:18 UTC
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
Comment 10 Daniel Veillard 2002-08-19 13:54:21 UTC
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
Comment 11 Daniel Veillard 2002-08-27 10:16:00 UTC
Okay, this should be fixed in the last releases,

Daniel
Comment 12 vnhu38f93 2002-08-27 11:04:42 UTC
I can confirm that this is fixed.
Comment 13 whitis 2004-11-06 14:34:53 UTC
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?