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

ID attribute defaults

  • From: "John E. Simpson" <simpson@p...>
  • To: xml-dev@i...
  • Date: Wed, 11 Nov 1998 14:41:55 -0500

idref effect
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@p...        | 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@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


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.