This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: [docbook-apps] Use of entityref to map generic path name in xml catalog
- From: Bob Stayton <bobs at sco dot com>
- To: "Miranda W. Hedrick" <mhedrick at pyramidonline dot com>
- Cc: docbook-apps at lists dot oasis-open dot org
- Date: Wed, 6 Aug 2003 22:23:20 -0700
- Subject: Re: [docbook-apps] Use of entityref to map generic path name in xml catalog
- References: <01b301c35c72$8ef342c0$1b03a8c0@DEV1116>
On Wed, Aug 06, 2003 at 06:29:18PM -0500, Miranda W. Hedrick wrote:
> I'm using xsltproc 2.5.8 on WindowsXP, working with
> DocBook 4.2. I have been able to successfully generate
> static HTML, HTMLHelp and PDF (via Fop) files using some
> customized XSL stylesheets. Very cool stuff! And now I
> have a couple of questions...
>
> I declared an entity as follows:
>
> <!ENTITY myimage SYSTEM "/path/to/images/myimage.gif" NDATA GIF>
>
> I then inserted a mediaobject that referenced the entity:
>
> <mediaobject>
> <imageobject>
> <imagedata entityref="myimage" format="GIF" />
> </imageobject>
> </mediaobject>
>
> ------------------------------------
>
> 1. When I process the XML, the image source is lost.
> I just get src="" within the generated IMG tag. If I just
> use fileref, the image renders properly. What am I doing
> wrong here?
It looks right, but somehow the entity is not resolving.
It doesn't matter if the path is correct, as it is
just passed through once the entity resolves.
Are you declaring the entity in the DOCTYPE,
or a separate file? The stylesheet doesn't
complain when it can't resolve such an entityref,
but it probably should.
>
> 2. I've read that I can reference a generic path name
> within my declared entity and then use the catalog to map
> it to a local directory. Can someone provide me with an
> example of how to code the catalog to do this?
Well, not for individual image files for HTML output.
A catalog is used only when a file being referenced
is actually opened. In HTML output, a graphics pathname is passed
straight through to the HTML output without being
opened, so the catalog resolver never kicks in.
You could, however, declare a pathname entity
in your image filerefs, and have that entity
resolve to different places on different systems.
<!ENTITY imagelib "/usr/share/images">
<imagedata fileref="&imagelib;/myfile.gif">
If you put this entity declaration in a separate
file and pull that declarations file in with a parameter
entity, you can use a catalog to find a different entity
declarations file (which would have a different
imagelib declaration). See this reference for more info:
http://www.sagehill.net/docbookxsl/GraphicsLocations.html
--
Bob Stayton 400 Encinal Street
Publications Architect Santa Cruz, CA 95060
Technical Publications voice: (831) 427-7796
The SCO Group fax: (831) 429-1887
email: bobs@sco.com
---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org