users@jaxb.java.net

how to specify the customization of these elements

From: Peizhao Hu <peizhao_at_itee.uq.edu.au>
Date: Thu, 01 Mar 2007 17:24:34 +1000

Hi,

as the _AbstractListType element is defined as xs:any element, there
should be able to define input element as below. however, when I use
JAXB 2.1 to bind these schema, I can only access the getAny(). I can't
define the input element as described in the schema. is there any
customization rule that I can use?


<xs:complexType name="inputsType">
        <xs:sequence minOccurs="0">
            <xs:element name="InputList" type="sml:_AbstractListType"/>
        </xs:sequence>
        <xs:attributeGroup ref="swe:AssociationAttributes"/>
</xs:complexType>


<xs:complexType name="_AbstractListType">
        <xs:sequence>
            <xs:any namespace="##any" processContents="strict"
maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="id" type="xs:ID" use="optional"/>
</xs:complexType>


<xs:element name="inputs">
        <xs:annotation>
            <xs:documentation>list of input signals</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:complexContent>
                <xs:restriction base="sml:inputsType">
                    <xs:sequence minOccurs="0">
                        <xs:element name="InputList">
                            <xs:complexType>
                                <xs:complexContent>
                                    <xs:restriction
base="sml:_AbstractListType">
                                        <xs:sequence>
                                            <xs:element name="input"
maxOccurs="unbounded">
                                                <xs:complexType>
                                                    <xs:group
ref="swe:AnyData" minOccurs="0"/>
                                                    <xs:attribute
name="name" type="swe:qnameSimpleType" use="required"/>
                                                    <xs:attributeGroup
ref="swe:AssociationAttributes"/>
                                                </xs:complexType>
                                            </xs:element>
                                        </xs:sequence>
                                    </xs:restriction>
                                </xs:complexContent>
                            </xs:complexType>
                        </xs:element>
                    </xs:sequence>
                </xs:restriction>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>

-- 
regards;
Peizhao