axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amila Suriarachchi" <amilasuriarach...@gmail.com>
Subject XML Union type problem
Date Wed, 07 Feb 2007 07:13:31 GMT
hi,
Can we use a simple type union as an attribute type? in other words is the
following xmlSchema fragment correct?

  <s:simpleType name="TestUnion">
        <s:union memberTypes="s:string s:int"/>
    </s:simpleType>

    <s:complexType name="TestUnionElement">
        <s:attribute type="s0:TestUnion"/>
    </s:complexType>

if so what could be the serialized xml pattern?

I recently implemented the Union type support for adb.
For a example Lets take following schema fragment

    <s:simpleType name="FooOpenEnum">
        <s:union memberTypes="s:int s:string"/>
    </s:simpleType>

 <s:element name="Record1">
        <s:complexType>
            <s:sequence>
                <s:element name="elem1" type="s0:FooOpenEnum"/>
            </s:sequence>
        </s:complexType>
    </s:element>

for the above schema part the serialized xml is as follows

<Record1>
         <elem1 xsi:type="xs:string>teststring</elem1>
</Record1>

does this xsi:type="xs:string part manadatory? (I think so)

Can someone comment on this?

Amila.

-- 
Amila Suriarachchi,
WSO2 Inc.

Mime
View raw message