[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [xml-dev] ID-ness in XML
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@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/ |
+----------------------------------+---------------------------------+