OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Problem with images given as entity in xhtml output (template process.image)

i am using docbook xsl 1.78.1 that comes bundled with the oxygem xml editor
version 16.0.  I think there is a problem (a bug?) in handling relative
filenames defined as entities in the stylesheets for xhtml output.

I have an article with an image. The image is defined as an unparsed entity,
its value is an relative filename. Something like

<!ENTITY img SYSTEM "image.png" NDATA PNG>
Used as
<imagedata entityref="img"/>
In my article.

When I try to generate xhtml output, the image is not visible. Problem is,
that its URL in the generated HTML file is "../../file:/C:/temp/image.png".
Obviously, it should be "file:/C:/temp/image.png"

Trying to find the reason, i found that the stylesheets make use of the
unparsed-entity-uri() function. In this case, this function will return the
value "file:/C:/temp/image.png".

Further investigation shows that the rather long template named
"process.image", defined in file "xhtml/graphics.xsl", generates an element
which name is given as the value of variable $tag. In my case it's the img
Element in the HTML file. This starts at line 554. 
Within this Element the value of the @src Attribute is defined (Line 579).
Basically, it's the value of $output_filename, but in some cases prepended
by the value of $img.src.path. The important condition is
"not(contains($output_filename, '://'))". This should check wheter it is an
absolute filename. However, unparsed-entity returns "
file:/C:/temp/image.png" with only one slash after the colon. That's why I
get the concatenation of $img.src.path and $output_filename.

Conclusion: I think that the condition within the @src-Attribute value
should read " not(contains($output_filename, ':/'))", that is, only one
slash after the colon, to catch absolute filenames generated by the
unparsed-entity-uri() function.
Transformation is done within oxygen. As far as I can see, it is done with
the xhtml/profile-docbook.xsl stylesheet using saxon 6.5 engine. Environment
is windows 7.

Frank Steimke

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]