OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] XInclude v. Entities (was Re: [xml-dev]canonicalization)

[ Lists Home | Date Index | Thread Index ]

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
>diffference.

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:

<!DOCTYPE SYSTEM "someURL.dtd">
<element xmlns="http://www.w3.org/2001/XInclude";>
   <xinclude:include href="someURL"/>
</element>

<!DOCTYPE SYSTEM "someURL.dtd">
<element xmlns="http://www.w3.org/2001/XInclude";>
   &URL;
</element>

>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@metalab.unc.edu | 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/    |
+----------------------------------+---------------------------------+




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS