XSchema Spec - Element Declarations (Section 2.2), Draft 5

Simon St.Laurent SimonStL at classic.msn.com
Sat Jul 18 15:31:54 BST 1998

Here's draft 5 of Element Declarations.  This was mostly minor cleanup, to 
make sure XSchema authors know that element names need to conform to the Name 
production, not merely the NMTOKEN production.  Attribute names received an 
initial cap to conform to the results of the earlier balloting and be 
consistent with the rest of the spec.  (id is a notable exception throughout 
the spec.)

As always, a prettier HTML version of this will be posted shortly at 

Simon St.Laurent
Dynamic HTML: A Primer / XML: A Primer / Cookies

2.2 Element Declarations

Element declarations in XSchemas are made using the XSC:ElementDecl element 
and its contents:

<!ELEMENT XSC:ElementDecl (XSC:Doc?, XSC:More?, (XSC:Ref | XSC:Choice | 
XSC:Seq | XSC:Empty | XSC:Any | XSC:PCData | XSC:Mixed), XSC:AttDef*)>
<!-- Name is the element name -->
<!ATTLIST XSC:ElementDecl 
       id ID #IMPLIED
       Root (Recommended | Possible | Unlikely) "Possible">

The XSC:Name attribute identifies the name of the element, and is required. An 
element declaration would look like:

<XSC:ElementDecl Name="Species">

This declaration would declare an element named "Species", which would appear 
in an instance as:


The XSC:Name attribute must be unique within the set of elements, as it 
provides the name of the element as declared here, and is also used by other 
elements to refer to this element in their content model declarations.  The 
XSC:Name attribute must also match the Name production in the XML 1.0 spec.  
(Effectively, this requires element names to begin with a letter, underscore, 
or colon.)

The XSC:id attribute, if it appears, must be unique within the document. This 
attribute may be used to uniquely identify this XSC:ElementDecl element for 
reference using XPointers and other tools. 

The XSC:Root attribute provides authoring tools with a guide for which 
elements are likely root elements for documents. This is intended to simplify 
the choices presented to authors during document composition. Composition 
tools could use this to build a menu of likely starting points for a document.
Note that an element must declare a content model of some type, even if that 
content model is empty. Documentation (in the XSC:Doc element), non-XSchema 
extensions (in the XSC:More element) and attribute declarations (using 
XSC:AttDef elements) are optional.

Documentation about the element, additional extensions, content-model 
information, and attribute information are stored as sub-elements of the 
XSC:ElementDecl element. Documentation is covered in 2.6.1, Documentation 
Extensions. Additional extensions are covered in 2.6.2, Further Extensions. 
Content Models are covered in 2.3, Content Model Declarations, and attributes 
are covered in 2.4, Attribute Declarations.

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

More information about the Xml-dev mailing list