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] Base URI for result of transformation?

Hi Tony,
The general behavior in XML is that a relative URL is taken as relative to 
the xml:base of the element containing the reference.  If there is no 
xml:base attribute, then it is taken as relative to the document containing 
the reference.  In the case of url('...') in an FO document, then the 
XSL-FO processor takes it as relative to the location of the FO document, 
not the XML source, for which it has no knowledge.

If you aren't using XInclude and you are using fileref (not entityref), 
then the DocBook FO stylesheet just copies the fileref out to the FO file, 
and the XSL-FO processor has to deal with that path.  So if your main 
document uses system entities to build its content from the modules, then 
any filerefs are not altered as they are copied to the FO.

If you are using XIncludes to assemble your content, then the XInclude 
processor adds xml:base attributes to the parsed XML before the stylesheet 
sees it.  By default the DocBook stylesheet resolves xml:base attributes 
for relative paths that it finds in any filerefs.  If you want to turn off 
that behavior when using XIncludes (and thus preserve the original fileref 
string), then you will need version 1.70.1 of the stylesheets and set the 
stylesheet parameter keep.relative.image.uris=1.

Bob Stayton
Sagehill Enterprises
DocBook Consulting

----- Original Message ----- 
From: "Tony Graham" <Tony.Graham@Sun.COM>
To: <docbook-apps@lists.oasis-open.org>
Sent: Friday, July 28, 2006 12:22 PM
Subject: [docbook-apps] Base URI for result of transformation?

> What is, or should be, the base URI (for purposes of resolving relative 
> URIs
> in "url('...')") for an FO document that is the result of transforming an
> input XML document with the DocBook FO stylesheets?
> I'm working on testing the xmlroff XSL formatter with the DocBook 
> testdocs,
> which have relative URI references in them, and the relative URIs end up 
> as
> "url('...')" in the FO document.
> To make matters worse, the relative URIs don't resolve from the test docs
> anyway.  For example, if 'docbook-testdocs-1.1/tests/stamp.001.xml' 
> refers to
> 'graphics/stamp.png', the actual 'stamp.png' is in the testdocs 
> distribution
> as 'docbook-testdocs-1.1/graphics/stamp.png', not as
> 'docbook-testdocs-1.1/tests/graphics/stamp.png'.
> I can rearrange the testdocs (or add symbolic links) so relative URIs 
> resolve,
> but that still leaves me wondering about what the correct base URI for 
> the FO
> document that is the result of a transformation.
> Is it:
> - The current directory?
> - The directory of the input XML document?
> - The directory of the input XSLT stylesheet?
> - None?
> - Something else?
> Regards,
> Tony.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org

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