> 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...
Useful or not, that's what's required by the spec. As I said in my previous
message, we do plan to provide more information via PSVI. Instead of
returning the name/namespace of the type definitions, we'll return an
object representing the type itself, from which you can get not only
name/namespace, but also the base type, primitive type, etc.
Cheers,
Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
[EMAIL PROTECTED]
Fabio Riccardi
<[EMAIL PROTECTED] To: [EMAIL PROTECTED]
m> cc:
Subject: PSVI getMemberTypeName for
unions always null?
04/22/2002
04:23 AM
Please respond
to
xerces-j-dev
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]