This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] relative graphic uri with entityref


I generate a non-system entity reference to a relative path FROM the DTD file.

Example. If I have a tag that looks like this:

<img src="../path/somewhere.png" >

<! ENTITY diagrams.blah.png "../from/dtd/relative/path/to/somewhere.png" >

This is usually the relative path from the XML source file to the image file, 
so you need to do a path mapping - I convert it to absolute with rel2abs and 
back to relative with abs2rel (relative to the path of the DTD file that I 
generate). 

I originally did it in perl and needed rel2abs and abs2rel, so I translated 
them in into python. I plan to post it online soon, but i am getting my 
spanking new MoinMoin together now.


On July 12, 2004 08:18 am, Mauritz Jeanson wrote:
> ----- Original Message -----
> From: "Simone Pacilli"
>
> > I tryed to execute what I read in
> > http://www.sagehill.net/docbookxsl/GraphicsLocations.html, but the html
> > output is never of the type:
> >
> > <IMG  src="graphics/tutorial3.png">
> >
> > but always of the absolute type like the following
> >
> > <IMG  src="file:/root/.../tutorial3.png">.
> >
> > I also tryed putting "static-catalog=yes" in my
> > CatalogManager.properties but I did not succeed.
> >
> > Is there a way to use "entityref" and obtain relative uri in html output
> > or is it necessary to use "fileref" ?
>
> With "entityref", the filepath is obtained with the unparsed-entity-uri()
> function, which always returns an absolute URI with Saxon and Xalan. With
> xsltproc (libxslt 1.1.8), it is relative if the SYSTEM identifier is
> relative.
>
> According to the XSLT 1.0 specification, the behaviour of Saxon and Xalan
> is the correct one: "if the system identifier is a relative URI, it must be
> resolved into an absolute URI using the URI of the resource containing the
> entity declaration as the base URI"
> (http://www.w3.org/TR/xslt#unparsed-entities).
>
> /MJ
>
> To unsubscribe from this list, send a post to
> docbook-apps-unsubscribe@lists.oasis-open.org, or visit
> http://www.oasis-open.org/mlmanage/.

-- 
S. Alan Ezust
Ottawa, Ontario, Canada
http://cartan.cas.suffolk.edu/~sae

To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]