Manuel Sánchez wrote:
> I'm having some problems to insert images with TEI-Lite.
> Does anybody out there know how to insert images in a XML document?
> I know I must insert the <figure> tag and fill in the "entity" attribute
> with the name of the file with the image. I do also know that I must
> declare the entity at the beginning of the document, I mean, I must write
> something like: [<!ENTITY figurename system 'figurename.jpg' NDATA jpeg>]
> after the name of the DTD.
> But my question is: Is there an easier way to insert images?
I was rather hoping someone else would jump in with the Correct Way.
In lieu of that, here's one way that works. Note that this assumes all
images are in the same directory.
Declare the entities thus:
[<!ENTITY figurename.jpg system 'figurename.jpg' NDATA jpeg>]
Note that the "figurename" in your declaration has the same name as the
file name. I believe you can get away with this so long as there are no
spaces in the file name and it doesn't start with a restricted character
(letters are OK).
In the <p> you have:
<figure entity="figurename.jpg" rend="left"></figure>
You then have an .XSL file to manage the transformation (or else deal
with it using the DOM. Here's one fragment:
If you had to refer to an external image directory you'd need more
information immediately before the <xsl:value-of>
All of this is a work around simply because I couldn't get it to
substitute the file name from the entity declaration. These seemed much
more inclined to deal with &entityname; substitutions for special
Not perfect, but it brings up the images at least ...
[log in to unmask]