Re: L3 Core: TypeInfo seems inadequate

On Fri, 2003-08-01 at 00:59, Curt Arnold wrote:
> 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.

Why not looking at the ancestors of the node where the TypeInfo is
attached?

>   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

typeName and typeNamespace cannot be both null if there is a
declaration. In your case, it will exposed the the namespace and local
name of the corresponding anonymous type name, with anonymous type name
being an implementation-defined, globally unique qualified name provided
by the processor for every anonymous type declared in a schema.

Philippe

Received on Thursday, 28 August 2003 16:23:54 UTC