W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2003

L3 Core: TypeInfo seems inadequate

From: Curt Arnold <carnold@houston.rr.com>
Date: Thu, 31 Jul 2003 23:59:05 -0500
Message-ID: <3F29F399.1080102@houston.rr.com>
To: WWW DOM <www-dom@w3.org>

Having attributes that allow you to readily determine if the type is 
complex vs simple or named vs anonymous would seem to be helpful.  Such as:

readonly attribute boolean isSimple;
readonly attribute boolean isAnonymous;  (may be redundant with typeName 
== null)

XML Schema Datatypes has equivalents for the DTD attribute types which 
could be used instead of null and attribute type property.  The current 
definition would not provide an easy way to distinguish between:

<!ATTLIST foo name CDATA #IMPLIED>

and

<!--  contrived, no namespace schema   -->
<xsd:schema>
<xsd:simpleType name="CDATA"/>
...
<xsd:attribute name="name" type="CDATA"/>
 

An anonymous type could be nested many levels down in the content model, 
a containingElements NameList attribute could be used to enumerate the 
element names.  For the schema:

<xsd:schema targetNamespace="http://www.example.com/typeinfo">
<xsd:element name="hello">
    <xsd:complexType>
         <xsd:choice>
             <xsd:element name="world">
                   <xsd:simpleType>...</xsd:simpleType>
             </xsd:element>

The TypeInfo associated with the world element in <hello 
xmlns="http://www.example.com/typeinfo"><world/></hello>

Would have

typeName == null,
typeNamespace == null,
isSimple == true,
containingElements.getNamespace(0) == "http://www.example.com/typeinfo",
containingElements.getName(0) == "hello"
containingElements.getNamespace(1) == null (if elementFormDefault = 
false) or "http://www..."
containingElements.getName(1) == world
Received on Friday, 1 August 2003 01:23:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:57 GMT