[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [xml-dev] Re: determining ID-ness in XML
- From: Marcus Carr <email@example.com>
- To: Rob Lugt <firstname.lastname@example.org>
- Date: Thu, 01 Nov 2001 10:40:38 +1100
Rob Lugt wrote:
> Much to Tim Bray's dismay, I think that a variation of James Clark's idea
> using PIs may be best:- Use an attribute name attribute, but make it a
> pseudo-attribute inside a processing instruction.
> e.g. <?xml-typeinfo idnames="abc:id, ID, id"?>
I agree, so despite the fact that it feels as though I'm swimming in concrete,
I'm making one last pitch for the idea of using a PI.
The relevance and accuracy of information about uniqueness of attribute values
is not static - it only relates to the instance at a particular point in time
and for a particular use, so shouldn't be hard-coded into the instance. The
reasons for using PIs are similar to those that motivated their use for
associating stylesheets. There are a number of characteristics of documents that
rightly belong at a level above the instance - the fact that it is an XML
document, the version it conforms to, DOCTYPE information, stylesheet
information. I see information about the uniqueness of values as belonging here
Adding an attribute to the root element or any other element is messy and
implies a certain range of uses for the document - editing would certainly not
be well served. A user of an only halfway clever application might be
considering what elements they could conceivably direct a link to. They put a PI
in the top of the document with a list of the elements and attributes they feel
they might wish to point at, and are immediately informed of which attributes
have failed the uniqueness check. They remove the offending values from the PI,
then continue to work. They cut and paste a fragment out of another XML document
and include it - if the attribute values aren't unique, they're told about it.
They decide to either change the values, or question whether they really need to
link to those elements...
This just all seems much more manageable than stripping attribute values in and
out of the instance depending on whether a DTD is available, or it's important
that the values be unique or whatever else. Does anyone really find the
xml-stylesheet processing instruction such a kludge?
Marcus Carr email: email@example.com
Allette Systems (Australia) www: http://www.allette.com.au
"Everything should be made as simple as possible, but not simpler."