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

Re: XSchema Spec Section 2.4, Draft 2

  • From: Chris Maden <crism@o...>
  • To: xml-dev@i...
  • Date: Wed, 24 Jun 1998 16:59:24 -0400 (EDT)

xschema editor
[Simon St.Laurent]

> <!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?)>
<!ATTLIST XSC:AttDef
          Name        NMTOKEN       #REQUIRED
          Type        (CData |
                       ID |
                       IDRef |
                       IDRefs |
                       Enitity |
                       NmToken |
                       NmTokens |
                       Notation |
                       Enumeration) "CData"
          Required    (Yes |
                       No)          "No"
          Fixed       (Yes |
                       No)          "No"
          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
given.

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".

<XSC:ElementDecl name="index">
  <!-- whatever content model -->
  <XSC:AttDef Name="id" Type="ID" Default="index"/>
</XSC:ElementDecl>

> <!-- XSC:CData through XSC:EnumerationValue identify attribute types -->
> <!ELEMENT XSC:CData EMPTY>
> <!ELEMENT XSC:ID EMPTY>
> <!ELEMENT XSC:IDRef EMPTY>
[etc.]

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;
maybe

<!ATTLIST XSC:AttDef
          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).

-Chris
-- 
<!NOTATION SGML.Geek PUBLIC "-//Anonymous//NOTATION SGML Geek//EN">
<!ENTITY crism PUBLIC "-//O'Reilly//NONSGML Christopher R. Maden//EN"
"<URL>http://www.oreilly.com/people/staff/crism/ <TEL>+1.617.499.7487
<USMAIL>90 Sherman Street, Cambridge, MA 02140 USA" NDATA SGML.Geek>

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.