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

Re: ID-ness in XML


id attribute xslt counter
At 9:45 AM +1100 11/11/01, Marcus Carr wrote:
>Here are some questions that bother me about the use of an attribute
>instead of a PI.
>
>1)  Why should an issue that most people consider to be orthogonal to
>validation interrupt validation as an instance moves between
>well-formedness and validity?
>

The name of the element instance (not the element type but the 
element instance) belongs with the instance. By far the simplest way 
to do this is to attach an attribute to the element. In fact, most of 
the processing instruction proposals involve using the PI only to 
identify these name attributes, not to actually name element 
instances. Adding the processing instruction seems like an additional 
layer of confusion when you're going to use an attribute anyway.

>2)  Given that the root element might be any element in the DTD, in
>order to cover themselves, the thorough DTD creator would have to
>declare it for every element. True? Does this seem counter-intuitive?
>Declaring the attribute locally x number of times seems inelegant, born
>out of a lack of a global mechanism.
>

Many DTDs already declare common attributes for all elements. For 
instance XHTML declares an ID attribute for all elements. With 
parameter entity references this can be done in a very clean way. The 
techniques to do this are well-known, well-documented, and 
well-understood in the community. It is not at all inconvenient.

>3)  As DTDs are by far the most frequently used tool for the development
>of an XML dataset, is it fair to assume that most XML documents are
>valid at at least one point in their lives?

It is absolutely not fair to assume this. If I had to guess, I'd 
venture that the opposite is true, that the majority of XML documents 
are never valid. Some XML applications which are almost never valid 
include XML-RPC, SOAP, XSLT, and RDF.

>  Accepting that, does it
>follow that the addition of the xml:id attribute has the potential to
>impact on most XML documents in existence? (Every one that conforms to a
>DTD.)

At worst, even accepting the faulty premise, xml:id only impacts on 
those documents that choose to use it because they have a need for 
it. And for these documents, the benefits outweigh the disadvantages. 
Otherwise the owners of those documents would not have chosen to add 
xml:id to their documents.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@m... | 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/     |
+----------------------------------+---------------------------------+

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
 

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.