You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Fabio Riccardi <fa...@xqrl.com> on 2002/04/22 10:23:24 UTC

PSVI getMemberTypeName for unions always null?

whenever I extract the getMemberTypeName or getMemberTypeNamespace of an 
item defined as a union the result is always null, for instance:

    <xs:attribute name="salary">
     <xs:simpleType>
      <xs:union>
       <xs:simpleType>
        <xs:restriction base='xs:integer'/>
       </xs:simpleType>
       <xs:simpleType>
        <xs:restriction base='xs:string'/>
       </xs:simpleType>
      </xs:union>
     </xs:simpleType>
    </xs:attribute>

every instance of salary will validate either as a xs:string or as an 
xs:integer. Xerces does return the type info of the validated member, 
which (by definition of union) is some anonymous simpleType with an 
inaccessible restriction, i.e. not very useful...

I think that, from what I can make out of the Schema Structures doc 
below, it should instead return the type of the base type (i.e. 
xs:integer or xs:string) of the restriction, am I wrong?

> [member type definition name] The {name} of the ·actual member type 
> definition·, if it is not ·absent·. If it is ·absent·, schema 
> processors may, but need not, provide a value unique to the definition.
>
> [member type definition] If and only if that type definition has 
> {variety} union, then an ·item isomorphic· to that member of its 
> {member type definitions} which actually ·validated· the attribute 
> item's [normalized value].

Regardless of the exactitude of my interpretation, how do we get useful 
information out of the PSVI?

TIA,

  - Fabio


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org