/ Patrick Eisenacher <[EMAIL PROTECTED]> was heard to say:
| I'm new to the list and I have a question regarding the use of the
| entityref and fileref attributes when including an image via the
| imagedata element. When do I use which attribute? Is it merely personal
| preference? What are the benefits? What are the drawbacks? What is the
| preferred way?

It is, to a large extent, personal preference. The use of entities
provides a degree of indirection that is sometimes useful. It was more
common, perhaps, in the pre-XML (and pre-web) days before URIs were a
widespread concept.

In order to use entityref, you must setup a more complex document structure:

<!DOCTYPE article PUBLIC "..." "..." [
<!ENTITY graphic PUBLIC "..." "..." NDATA PNG>
]>
<article>
...
<imagedata entityref="graphic"/>

When the document is processed, the PUBLIC and SYSTEM identifiers are
used to resolve the actual location of the 'graphic'. This means that
a catalog or other resolver mechanism can make dynamic selections.

It's also possible to put the entity declarations in an external file
and switch between them wholesale. For DocBook: TDG, there are several
hundred 'unicode character' graphics. For the HTML version of the
book, these are all PNGs; for the print version, they're all EPSes. I
switch between the two by selecting different sets of entities.

| The processing expectations say:
|> There are two ways to provide content for ImageData: EntityRef or FileRef. It is 
|best to use only one of these methods, however, if multiple sources are provided, 
|EntityRef will be used in favor of FileRef.
|
| How do I have to understand 'if multiple sources are provided' - if I
| specify a fileref and an entityref attribute for the same imagedata
| element?

Yes.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <[EMAIL PROTECTED]>      | Extinction, n. The raw material
http://www.oasis-open.org/docbook/ | out of which theology created the
Chair, DocBook Technical Committee | future state.--Ambrose Bierce

Reply via email to