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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   ID attribute defaults

[ Lists Home | Date Index | Thread Index ]
  • From: "John E. Simpson" <simpson@polaris.net>
  • To: xml-dev@ic.ac.uk
  • Date: Wed, 11 Nov 1998 14:41:55 -0500

I understand why IDs don't typically have defaults, each one required to be
unique.

OTOH, what about a data-based (not database-based) XML app whose content
model, especially at the top of the tree, consists largely of elements
which may occur only once in an entire document instance? It seems to me
that there's still potential value in assigning such elements a fixed
"default" value -- primarily for purposes of internal cross-references.

Tim Bray's annotated XML spec says (in the annotaton on production [56]
regarding the IDREF validity constraint), "In general, it's a good idea to
attach ID attributes to as many elements as possible in every document,
because, later, if you decide you need to point at anything, you'll be
happy if it has an ID attribute ready for use." Agreed. 

Later, in the discussion of the #FIXED attribute type (prod. [60]), he says: 

    ....suppose, for example, that I insert a pointer here to 
    my favorite piece of the XML spec. When I do this, I use an 
    element named Sref (for Spec-ref), which becomes an A 
    element in the HTML version. However, in all cases, I want 
    that pointer to get another attribute target='spec'", so 
    that when you use it, it takes effect in the left-hand frame, 
    which is named spec.

    So that I don't have to enter that attribute in each Sref 
    element, the internal subset contains this:

       <!ATTLIST Sref target CDATA #FIXED "spec">

This is exactly what I'd like to do. But this seems like something of a
gimmick to reproduce the effect of the ID/IDREF attribute types, one which
furthermore requires an app to interpret -- not leveraging the built-in
cross-reference facility.

What am I missing? Is there some way both to use ID/IDREF *and* not require
the document author to supply IDs on her own?

Thanks for any brainstorms,
John E. Simpson

========================================================
John E. Simpson            | It's no disgrace t'be poor,
simpson@polaris.net        | but it might as well be.
http://www.flixml.org      |            -- "Kin" Hubbard

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)





 

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

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