I am trying to create a union between long and an empty string, but only the
empty string simple type shows up in the xsd that is being created.

This is the code i am using to create the Union:

                                Union emptyableLongType = new Union(schema);    
                        
                                SimpleType stringType = schema
                                                .createSimpleType(null, 
simpleTypesFactory
.getBuiltInType(simpleTypesFactory.getBuiltInTypeName(SimpleTypesFactory.STRING_TYPE)));
                                stringType.addFacet(new Facet(Facet.PATTERN, 
""));                                              
                                emptyableLongType.addMemberType(stringType);
                                emptyableLongType.addMemberType(longType);

but the resulting type in the schema looks like this:

          <xs:element name="some_element" minOccurs="0">
            <xs:simpleType>
              <xs:union>
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:pattern value=""/>
                  </xs:restriction>
                </xs:simpleType>
              </xs:union>
            </xs:simpleType>
          </xs:element>

what am I doing wrong?







-- 
View this message in context: 
http://www.nabble.com/Union-not-properly-working-in-schema-generation-tp23317574p23317574.html
Sent from the Castor - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to