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

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xml-dev] Re: determining ID-ness in XML



At 12:33 AM -0800 11/9/01, Christopher R. Maden wrote:


>Right, but Marcus's point is that there are no (0) XML documents written to
>a DTD before xml:space existed.
>

True.

>There are valid XML documents written without xml:id.
>

True.

>It would be good for non-DTD-reading systems to know about IDs in those
>documents.
>

Yes, but this can be done by fixing those systems so they read the 
DTD. The number of non-validating parsers is quite small these days 
relative to validating parsers. In fact, in Java I think there's 
exactly one maintained, non-validating parser and it's bundled with a 
validating parser. There are a few more in other languages, but I do 
not find the situation to be so bad that we need to consider 
non-DTD-reading systems at the expense of everything else. I'm much 
more worried about documents that don't have DTDs than about parsers 
that can't or won't read the DTD. Valid documents already have 
well-defined means of specifying IDs. If the client application 
chooses to ignore the information the document provides, that's its 
problem, not ours.

>Adding xml:id will invalidate those documents.
>

Yes, unless you rewrite the DTD.

>Re-writing the DTDs is not workable.
>

I totally disagree with this. XML applications and DTDs are rewritten 
all the time. MathML 1.0 begat MathML 2.0. SMIL 1.0 begat SMIL 2.0. 
XHTML 1.0 begat XHTML 1.1. DTDs change in order to add new 
functionality. If you don't want to change your DTD and you need 
valid documents, then you don't get the new functionality. You have a 
choice: update your DTD or don't use xml:id. I'm OK with that.

>Inserting an internal subset or adding PIs to the instances is.
>

Yes, there's more than one solution. Internal subsets are legal, and 
can even make documents using xml:id valid when the master DTD says 
they're not. However, they're not a very convenient solution, 
especially when you want lots of IDs on lots of different elements. 
This feels like a hack. I can't see this being adopted by developers 
in large numbers.

PIs also work, in part, especially if you imagine just one PI in the 
prolog listing all the ID attributes in the document. However, this 
tends to fail when documents start getting taken apart and put back 
together along with pieces of other documents. One of the goals for 
IDs/names instead of location based linking is that it's more robust 
against transforms. You can put multiple PIs inside elements or right 
before start-tags, but that's really messy, and still can't be easily 
made to survive an XSLT transform. Not impossible, of course. Just 
difficult.

A simple attribute based syntax, either xml:id, xlink:label, or 
xml:idatts seems to be the solution that is most robust, easiest to 
implement, and easiest to sell to developers.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|              http://www.ibiblio.org/xml/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.ibiblio.org/xml/     |
+----------------------------------+---------------------------------+