[xsd-users] Default value for complex type/element

Carmi, Eyal (Eyal) carmi at avaya.com
Wed Mar 1 08:23:27 EST 2006


Hi,
 
I have two elements, both belong to the same complex type(see example
below). I wish to set different default values for these elements, is
that possible? Also, is is possible to create a "fix" complexElement
(I.e. to represent a complex constant).
 
Example:
            <xs:element name="Boys">

                        <xs:complexType>

                                    <xs:sequence>

                                                <xs:element name="boy1"
type="myType"/>

                                                <!-- default age = 5 -->

                                                <xs:element name="boy2"
type="myType"/>

                                                <!-- default age = 12
-->

                                    </xs:sequence>

                        </xs:complexType>

            </xs:element>

            <xs:complexType name="myType">

                        <xs:sequence>

                                    <xs:element name="age"
type="xs:integer"/>

                                    <xs:element name="name"
type="xs:string"/>

                        </xs:sequence>

            </xs:complexType>

 
 
Thanks,
 
Eyal Carmi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060301/d8e61310/attachment.htm


More information about the xsd-users mailing list