[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: Fri, 18 Dec 2009 15:13:34 GMT
Re:  retaining entity declarations while converting fro
>  NDATA ccitt4">


As i said in my inital reply, I suspected that you were using NDATA
entities. Despite the fact that your example code did not use this form.

This completely changes the question  as while it's true that you lose
the declarations, you do not (unlike a normal parsed entity) lose the
entity references.

> I need to retain those in my intermediate output.

By far the simplest way, if you can control the source, is not to do this

<!DOCTYPE example[
<!ENTITY  t1 SYSTEM "image.tif" NDATA ccitt4">

but instead do this

<!DOCTYPE example SYSTEM "images.ent">

images.ent containing
<!ENTITY  t1 SYSTEM "image.tif" NDATA ccitt4">

then you can use <xsl:output doctype-system="images.ent"/> and the same
declaration is used for both input and output.

But if you really do need to dynamically detect which declarations are
usied in the source you need to either read the source as text  using
unparsed-text() and extract the DOCTYPE or use an extension function or
modified parser that passes on doctype information via some mechanism. The XDM model
used by XPath/XSLT to model the input document has no record of the
DOCTYPE used. Andrew's lexev might be able to do this, I coudn't tell
from the web page whether it reported entity declarations in teh local
subset  of the dtd or only reported teh public and system ids.


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.