[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: Ganesh Babu N <nbabuganesh@xxxxxxxxx>
Date: Wed, 16 Dec 2009 10:31:30 +0530
Re:  retaining entity declarations while converting fro
Hai,

Please look at the saxon extension function saxon:doctype.

http://saxon.sourceforge.net/saxon6.5.5/extensions.html#saxon:doctype

which provides the mechanism to create the entities. In your case you
have to re-generate the entities in XML file.

Regards,
Ganesh


On Wed, Dec 16, 2009 at 6:23 AM, David Carlisle <davidc@xxxxxxxxx> wrote:
>
>> 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
> them.
>
> 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
> xml)
>
> As you haven't shown how you are referencing the entities in the source
> file I can't really guess what to suggest.
>
> david
>
> ________________________________________________________________________
> 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

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.