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

Re: XInclude v. Entities (was Re: canonicalization)

xinclude entity
At 2:15 PM +1100 3/6/02, Rick Jelliffe wrote:

>Let us look at ID and IDREF checking. With XML 1.0, because entities
>must be included (for validity) we have all the information to decide
>if IDs are unique and IDREFs correspond to IDs.  

As you do with XInclude. Give me a document and its DTD, and I'll 
tell you if all the IDs are unique and what the IDREFs point to. 
During this process, no merging will be performed. All elements will 
be treated equally because the DTD semantics outlined in XML 1.0 do 
not say that any elements are special with regard to ID checking.

>Using XInclude, in order to check XML Schema's keyref/uniqueness constraints,
>we will need to work off the included document (unless the inclusions
>are arranged so that all keyref/uniqueness contexts are scoped within
>a single document each.)  

No, you don't need to work off the included document. You can if you 
want to, but you can also apply a schema to the unmerged document. 
The pre-merge and post-merge documents are two different documents; 
and a schema can be applied to either one, or neither. You can use 
the same or different schemas.

>If key/uniqueness is an important consideration, then XInclude has to
>work exactly the same as XML 1.0 does now. It is just a syntax

I'm not sure what you mean by "exactly the same as XML 1.0 does now", 
but I doubt it's just a syntax difference. The infosets for these two 
documents are different even when the entity reference and the 
XInclude element point to the same document:

<element xmlns="http://www.w3.org/2001/XInclude">
   <xinclude:include href="someURL"/>

<element xmlns="http://www.w3.org/2001/XInclude">

>So I doubt that XInclude actually should be seen as a replacement
>for low-level entities, despite its sales pitch.  It seems more
>useful for "SUBDOC" inclusions (in SGML terms) where
>one might expect or use a different namespace.

I don't think it's a replacement for low-level entities. I'm not even 
sure it's been pitched that way. The current spec even says that 
"There are a number of differences between XInclude and [XML 1.0] 
external entities which make them complementary technologies" right 
up front. I think people keep trying to force it to be that, but it's 
not. There's a real tendency in the tech world to

A. Try to force every new technology into the niche the old technology filled.
B. Claim that the new technology replaces the old technology

We saw this in XML vs. HTML. We saw this in Java vs C++ (and even XML 
vs. Java). We saw it in relational databases vs. hierarchical 
databases. We're seeing it now in the schemas vs. DTDs debate. I find 
myself constantly disabusing people of the notion that schemas 
somehow replace or substitute for DTDs, and that now that we have 
schemas DTDs are deprecated.

XInclude and external entities are similar. Entities will continue to 
be used for what they're good for. XIncludes will be used for what 
they're good for. Both will coexist.

| Elliotte Rusty Harold | elharo@m... | Writer/Programmer |
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|             http://www.cafeconleche.org/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |


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

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.