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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

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

[ Lists Home | Date Index | Thread Index ]
  • From: "Simon St.Laurent" <SimonStL@classic.msn.com>
  • To: "Xml-Dev (E-mail)" <xml-dev@ic.ac.uk>
  • Date: Fri, 7 Aug 98 20:38:47 UT

Below is the latest version of the Element Declarations section of the XSchema 

draft.  There are two innovations:

1) In keeping with our attempt to scale the latest namespace draft, the prefix 

and ns attributes have been added to the ElementDecl element.  These provide a 

prefix for DTD conversion and a namespace name for resolution.  Hopefully, 
this means that XSchemas will be ready to run with namespaces.

2) After much debate, which still has some loud dissent, I've added the Model 
element to hold the content model for elements.  It allows documentation of 
the content model separately from documentation of the element; it also will 
allow for friendlier containerization of content models in processing.  Or so 
I hope.

As always, a prettier HTML version of this will be posted shortly at 
http://purl.oclc.org/NET/xschema. (I'm having problems with AOL's FTP services 

again, so it may be tomorrow...)

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



2.2 Element Declarations

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

<!ELEMENT ElementDecl (Doc?, More?, Model, AttDef*)>
<!-- Name is the element name -->
<!ATTLIST ElementDecl 
       Name NMTOKEN #REQUIRED
       id ID #IMPLIED
       prefix NMTOKEN #IMPLIED
       ns CDATA #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">
       ...additionalElementInformation... 
</XSC:ElementDecl>

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

<Species>...content...</Species>

The 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 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 id attribute, if it appears, must be unique within the document. This 
attribute may be used to uniquely identify this ElementDecl element for 
reference using XPointers and other tools. The prefix attribute identifies the 

prefix that will be applied to this elements and its attributes during 
conversion to DTDs, unless overridden in the attribute declaration itself. The 

ns attribute identifies the URI which functions as the namespace name for this 

element and its attributes. Namespace processing is covered further in Section 

3.0, "XSchema and Namespaces".

The 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.  The 
Root attribute is purely a suggestion and does not require any action on the 
part of the processor.

Note that an element must declare a content model of some type, using the 
Model element, even if that content model is empty. Documentation (in the Doc 
element), non-XSchema extensions (in the More element) and attribute 
declarations (using AttDef elements) are optional.

Documentation about the element, additional extensions, content-model 
information, and attribute information are stored as sub-elements of the 
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@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