- From: Curt Arnold <carnold@houston.rr.com>
- Date: Thu, 31 Jul 2003 23:59:05 -0500
- 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 UTC