You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Ar...@iwaysoftware.com on 2006/03/03 18:14:01 UTC

Default attribute value and serialization

Hi,

 

There appears to be a problem in XMLBeans with handling of default
values for attributes.  I have an attribute in my schema that has a type
of enumeration and also has a default value

 

             <xs:attribute name="method" type="com:HTTPMethod"
default="POST"/>

 

       <xs:simpleType name="HTTPMethod">

             <xs:restriction base="xs:string">

                    <xs:enumeration value="GET"/>

                    <xs:enumeration value="POST"/>

             </xs:restriction>

       </xs:simpleType>

 

When I create my document using XMLBeans and serialize it via
save(OutputStream), I end up with the method attribute having an empty
value.  However, if I make a call to getMethod(), I'm getting the
expected default value.  What am I doing wrong?

 

Thank you,

 

Artem