Lists Home |
Date Index |
- From: Chris Maden <firstname.lastname@example.org>
- To: email@example.com
- Date: Wed, 24 Jun 1998 16:59:24 -0400 (EDT)
> <!ELEMENT XSC:AttDef (Doc?, (CData | ID | IDRef | IDRefs | Entity |
> Entities | NmToken | NmTokens | NotationType |
> EnumerationType),(Required | Implied | Fixed | AttValue))>
> <!-- Name is the name of the attribute -->
> <!ATTLIST XSC:AttDef name NMTOKEN #REQUIRED >
[First of all, all those child elements need namespace qualifiers.]
This seems unnecessarily verbose in the extreme. What's wrong with
<!ELEMENT XSC:AttDef (XSC:Doc?)>
Name NMTOKEN #REQUIRED
Type (CData |
Required (Yes |
Fixed (Yes |
Enumeration NMTOKENS #IMPLIED
Default CDATA #IMPLIED>
The name is the name of the attribute.
The type is the type of the attribute; if the type is Notation or
Enumeration, then the enumeration attribute is required.
The required attribute takes "yes" or "no"; "yes" is the same as
#REQUIRED; "no" is the same as #IMPLIED.
For the fixed attribute, "yes" is the same as #FIXED, and "no" is the
same as its absence.
The enumeration attribute takes a list of tokens (since only tokens
can be given in an enumerated list).
The default value is just that; it must comply with whatever type was
Here's where it gets interesting: Does XSchema have to limit itself to
the capabilities of DTDs? If so, why bother? Think about this:
<XSC:AttDef Name="one-of-these" Type="IDRef" Required="Yes"
Enumeration="index biblio gloss"/>
You can't do that with DTDs. The value for one-of-these must be
specified, and it must be a legitimate IDREF, but it is constrained to
one of the specific IDs listed.
Another example that someone in this group (one of the Peters?) raised
is default ID names. This is illegal in XML 1.0, but for my <index>
element, nine times out of ten, the ID is "index".
<!-- whatever content model -->
<XSC:AttDef Name="id" Type="ID" Default="index"/>
> <!-- XSC:CData through XSC:EnumerationValue identify attribute types -->
> <!ELEMENT XSC:CData EMPTY>
> <!ELEMENT XSC:ID EMPTY>
> <!ELEMENT XSC:IDRef EMPTY>
Any time you have a huge slew of EMPTY elements, think that maybe they
should be attributes.
> In XSchema 1.0, an attribute declaration (XSC:AttDef element) must
> be nested within the element declaration (XSC:ElementDecl element)
> for the element to which the attribute belongs.
This gives less functionality than XML DTDs, since you can have
multiple ATTLISTs for one element type. XSchema should provide that;
ElementType NMTOKEN #IMPLIED>
If the AttDef specifies an ElementType, it applies to the named
element type. If not, and it is contained in an ElementDecl, then it
applies to that element type; otherwise it is an error.
And BTW, I still don't like this capitalization method. I'm all for
<xsc:attdef>; I do all my coding by hand (and so will everyone else,
until an XSchema editor is written; don't hold your breath).
<!NOTATION SGML.Geek PUBLIC "-//Anonymous//NOTATION SGML Geek//EN">
<!ENTITY crism PUBLIC "-//O'Reilly//NONSGML Christopher R. Maden//EN"
<USMAIL>90 Sherman Street, Cambridge, MA 02140 USA" NDATA SGML.Geek>
xml-dev: A list for W3C XML Developers. To post, mailto:firstname.lastname@example.org
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:email@example.com the following message;
To subscribe to the digests, mailto:firstname.lastname@example.org the following message;
List coordinator, Henry Rzepa (mailto:email@example.com)