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: Re: [docbook-apps] XInclude and Graphics


Hi George,
There is no question that the xml:base attribute that xmllint puts on the
<section> element is wrong.  A nested relative xml:base attribute is always
relative to the container element's xml:base.  In the xmllint output, it
should be just:

<section xml:base="s-central-open-invoices.xml">

And by using xsl:message statements in a section template, I confirmed that
the Xerces parser with XInclude is getting it wrong as well.  I think your
tests confirm that when the xml:base attribute is correct, then the
stylesheet does the right thing.  It is impossible for the stylesheet to
compensate for incorrectly generated xml:base values.

I also find it hard to believe that both parsers are inserting the same
xml:base value, but the evidence is pretty plain.  I'm going to file a bug
report on libxml2 to see if this can get fixed.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- 
From: "Georges Schmitz" <georges.schmitz@heitec.de>
To: "Bob Stayton" <bobs@sagehill.net>
Cc: "docbook-apps" <docbook-apps@lists.oasis-open.org>
Sent: Wednesday, June 22, 2005 4:40 AM
Subject: Re: [docbook-apps] XInclude and Graphics


> Hi Bob,
>
> as I tested older libxml versions (I even gave 2.6.13 and 2.6.14 a
> chance) and got no difference in the resolved output, I made 2 further
> steps:
>
> (A)
> I changed manually in the resolved document
>
>     <section xml:base="../central/invoice/s-central-open-invoices.xml">
>
> into
>
>     <section xml:base="s-central-open-invoices.xml">
>
> The stylesheets then produce correct image paths.
>
> (B)
> I commented out the places containing xpointer in my document and let
Xalan (with resolver.jar) do the job directly on my source document, so no
(potential) bug from libxml could interfere.
>
> But then again I got
>
>  <fo:external-graphic
> src="url(../central/central/invoice/images/open-invoice-pos-detail.png)"
>
> in the FO output.
>
> Let me formulate this carefully: maybe xml:base relative to the main file
is correct and the bug is nonetheless in the stylesheets, else resolver.jar
would have the same bug as libxml. Or again, the specs of xinclude aren't
clear enough at the end?
>
> Regards,
> Georges
>
>
>
> Bob Stayton wrote:
>
> >What version of libxml2 are you using?  This looks like a bug in xmllint
> >that was fixed awhile ago.  The xml:base that xmllint inserts in the
> ><section> element is wrong, as it should be relative to the xml:base in
its
> >containing chapter element.  I think this was fixed in 2.6.15.  Unless it
is
> >broken again.
> >
> >Bob Stayton
> >Sagehill Enterprises
> >DocBook Consulting
> >bobs@sagehill.net
> >
> >
> >----- Original Message ----- 
> >From: "Georges Schmitz" <georges.schmitz@heitec.de>
> >To: "docbook-apps" <docbook-apps@lists.oasis-open.org>
> >Sent: Monday, June 20, 2005 8:30 AM
> >Subject: [docbook-apps] XInclude and Graphics
> >
> >
> >
> >
> >>In my main file (stored in "D:\BAZL\doc\de\ml") I include a chapter with
> >>XInclude:
> >>
> >>  <xi:include href="../central/invoice/ch-invoice.xml" ...
> >>
> >>ch-invoice.xml is stored in "D:\BAZL\doc\de\central\invoice". The same
> >>directory contains sections, that are included in this chapter again
> >>with XIncludes:
> >>
> >>  <xi:include href="s-central-open-invoices.xml" ...
> >>
> >>In this sections, I use graphics:
> >>
> >>  <imagedata fileref="images/open-invoice-pos-detail.png" ...
> >>
> >>------------
> >>
> >>Resolving all XIncludes with xmllint, my document looks like the
> >>following:
> >>
> >>  <chapter xml:base="../central/invoice/ch-invoice.xml">
> >>    <title>Fakturierung</title>
> >>    ...
> >>    <section xml:base="../central/invoice/s-central-open-invoices.xml">
> >>      <title>Verwaltung der offenen Rechnungen</title>
> >>      ...
> >>      <imagedata fileref="images/open-invoice-pos-detail.png"
> >>
> >>
> >>But the stylesheet produces the resulting FO output:
> >>
> >>  <fo:external-graphic
> >>src="url(../central/central/invoice/images/open-invoice-pos-detail.png)"
> >>
> >>
> >/>
> >
> >
> >>with "central/" included 2 times.
> >>
> >>Where does this error come from? I'm not sure, if the xml:base attribute
> >>of the resolved section should not simply be
> >>
> >>  <section xml:base="s-central-open-invoices.xml">
> >>
> >>(calculated from the included chapter) or if the current file is the
> >>determining factor (the latter would make more sense in my eyes).
> >>
> >>So is this a stylesheet bug?
> >>
> >>Thanks for explaining me,
> >>Georges
> >>
>
>
>




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