This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: External Unparsed Entities
- To: "Williams, Brad" <Bawilliams at firstam dot com>
- Subject: Re: [xsl] External Unparsed Entities
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Wed, 25 Apr 2001 18:12:06 +0100
- CC: xsl-list at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <F16E03C431B5D211893000104BC5C1A708AB4122@powaymail.credco.firstam.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Brad,
> This may seem elementary, but can someone please tell me why the
> following code(this is only an excerpt from the relevant XML file)
> will not import my JPEG? Is there an XSLT alternative to importing
> the file?
What are you expecting it to do? In your DTD you say that the entity
LOGO is a JPEG external unparsed entity to be found at 'team.jpg'. In
the XML you reference that entity, but an XML parser won't do anything
with that in particular, it's just a reference to that image.
If you want to, for example, create some HTML with an img element that
references that same image, then you need the
unparsed-entity-uri() function, which takes a (string) entity name and
gives you the URL for it, so in your case:
unparsed-entity-uri('LOGO')
will give you the URL
.../team.jpg
It gives you the absolute URL for the entity.
So you could do:
<xsl:template match="IMAGE">
<img src="{unparsed-entity-uri(@SOURCE)}" />
</xsl:template>
to get the XSLT to generate an HTML img element for the relevant
image.
I hope that helps,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list