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

PROPOSAL: type assignment based on tag name and presence/absense of attr

  • From: "Arnold, Curt" <Curt.Arnold@h...>
  • To: "'xml-dev@i...'" <xml-dev@i...>, "'www-xml-schema-comments@w...'" <www-xml-schema-comments@w...>
  • Date: Thu, 6 Jan 2000 09:46:39 -0700

proposal for assignment
Earlier version of XML Schema (http://www.w3.org/1999/05/06-xmlschema-1/) and many existing XML schemas use distinct tagnames for declaration and reference.  The simplification initiative unified the
tag names but at the lost of a substantial degradation of the effectiveness of validation of schema documents.  This proposal recaptures the validation effectiveness of distinct declaration and
reference elements by allowing element to type binding to be conditional on the presence or absense of an attribute.
For example:
<attrGroup name="myattgroup">
	<attrDecl name="name"/>
	<attrDecl name="id"><datatypeRef name="ID"/></attrDecl>
</attrGroup>
<attrGroupRef name="myattgroup"/>
Since these distinct tag names where associated with different types the content models of the attrGroup and attrGroupRef were different.  You could put a attrDecl in an attrGroup but not in an
attrGroupRef.
The simplification initiative resulted in one tag name that could serve either as a reference or a declaration depending on whether the ref or name attribute was provided.  However this prevents
either DTD or schema processors to detect logically invalid constructs like:
<attributeGroup ref="myattgroup">
	<attribute name="name" type="NMTOKEN"/>
</attributeGroup>
Proposal:
Enhancing the <element> element with additional attributes "withAttribute" and "withoutAttribute" which is the name of an attribute that must (or must not) be present for the association of the tag
name to type be effective.
So for example, attribute would be reworked something like this
<type name="elemDecl" source="annotated" derivedBy="extension">
     <group order="choice" minOccurs="0">
      <element name="datatype" type="anonDatatype"/>
      <element name="type" type="anonType"/>
     </group>
     <group order="choice" minOccurs="0" maxOccurs="*">
        <element ref="unique"/>
        <element ref="key"/>
        <element ref="keyref"/>
     </group>
     <attributeGroup ref="typeRef"/>
     <attribute name="equivClass" type="QName"/>
     <attributeGroup ref="occurs"/>
     <attributeGroup ref="valueConstraint"/>
     <attribute name="nullable" type="boolean" default="false"/>
     <attribute name="abstract" type="boolean" default="false"/>
     <attribute name="final" type="boolean" default="false"/>
     <attribute name="exact" type="exactSet"/>
    </type>

<type name="elemRef" source="annotated" derivedBy="extension">
    <attribute name="ref" type="QName"/>
     <attributeGroup ref="occurs"/>
     <attributeGroup ref="valueConstraint"/>
</type>

<!--  the unique keys for element declarations would have to be redone  -->
<element name="element" withAttribute="name" type="elemDecl" equivClass="element"/>
<element name="element" withAttribute="ref" type="elemRef" equivClass="element"/>	

Effects:

This would allow a schema validator to more effective validate schema documents and other documents that use one tag name in different uses in the same context.  The implementation and performance
cost should be negligable. Explicit definition of the key attributes allows the determination of the proper type to use with only looking at the start element.


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/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@i... the following message;
unsubscribe 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.