[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Use of entityref to map generic path name in xml catalog
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
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]