[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: retaining entity declarations while converting fro

Subject: Re: retaining entity declarations while converting from one xml format to another
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 16 Dec 2009 00:53:12 GMT
Re:  retaining entity declarations while converting fro
> I am sorry I forgot to mention one piece of information here. These
> input files were originally SGML and were then converted to well

but assuming spoon.jpg is a jpeg file, the same would apply in SGML as
well, image entities should be NDATA (not parsed) and referenced as
attribute values, not using &  ; notation.

> So when I do the <xsl:copy> the entities are not copied over.

parsed entities (referenced by &) are expanded by the XML parser before
XSLT even sees the input. So XSLT can not copy them as it never sees

But you can not reference a jpg file that way.

An NDATA entity is referenced as attribute value typically
something like

<!ENTITY spoon.jpg SYSTEM "spoon.jpg" NDATA jpg>

 <image ref="spoon.jpg"/>

if you access the entity this way, then the attribute value is available
to xslt and you can look up the SYSTEM URI using unparsed-entity-uri().

But you showed a parsed entity declaration

<!ENTITY spoon.jpg SYSTEM "spoon.jpg" >

which would be acceessed by

& s p o o n . j p g ;

such a reference would be expanded by the xml parser before xslt sees
the data (and generate a fatal error if it is a jpeg file rather than

As you haven't shown how you are referencing the entities in the source
file I can't really guess what to suggest.


The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.