RE: XSL and entities

Subject: RE: XSL and entities
From: Bryce Ferguson <Bryce.Ferguson@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 15 May 2000 16:24:16 -0700
Thanks for the response. Unfortunately, I'm constrained by the DTD so I
can't add an attribute for file name. In doing more looking the most elegant
approach would be to use the following:

<img src="{unparsed-entity-uri(@image)}"/>

This still doesn't work in all parsers. My workaround is to embed the
filename in the @figname attribute value.

-----Original Message-----
From: Eric van der Vlist [mailto:vdv@xxxxxxxxxxxx]
Sent: Monday, May 15, 2000 2:19 PM
To: xsl-list@xxxxxxxxxxxxxxxx
Subject: Re: XSL and entities


Bryce,

> I have a challenge and I'm not finding any examples that relate to this.
The
> problem is I have entities in my XML document that identify picture files.
> These entities are referenced in the body of the document in an attribute
of
> the graphic element in a figure element. The goal is to transform the XML
> into HTML which means I need to insert the filename into an <IMG> HTML
> element. I've included both a short XML fragment and the relevant fragment
> of the XSL below.


You can't do this like you are showing it in your example (it's the
almost the same topic we are discussing under the title "feature
request") as the entities are resolved by the XML parser and their name
is not available by the XSLT transformation.

One way to work around this is to add the filename in your XML tree for
example like this :

 <graphic figname="fig01" figfile="&fig01;"/>

Eric
-- 
------------------------------------------------------------------------
Eric van der Vlist       Dyomedea                    http://dyomedea.com
http://xmlfr.org         http://4xt.org              http://ducotede.com
------------------------------------------------------------------------


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread