Hi there,

 

I’m new in using xmlbeans and xml schema.  We are trying to migrate an existing application that uses jaxb to xmlbeans.  The current application uses jaxb 1.6 version.  I have several questions regarding specific jaxb custom binding extensions that are used and try converting this to xmlbeans standard.

 

  1. JAXB version:

      <xsd:element name="AvailabilityResponse">

                  <xsd:complexType>

                              <xsd:sequence>

                                          <xsd:element ref="ResponseItem" minOccurs="0" maxOccurs="unbounded">

                                                      <xsd:annotation>

                                                                  <xsd:appinfo>

                                                                              <jxb:property name="responseItems"/>

                                                                  </xsd:appinfo>

                                                      </xsd:annotation>

                                          </xsd:element>

                              </xsd:sequence>

                  </xsd:complexType>

      </xsd:element>

 

How would you define this is xmlbeans schema format.  Since I can not use the “jxb:property name=…”

 

  1. JAXB version:

            <xsd:element name="Day" type="xsd:date" minOccurs="0">

                        <xsd:annotation>

                                    <xsd:appinfo>

                                                <jxb:property generateIsSetMethod="true"/>

                                    </xsd:appinfo>

                        </xsd:annotation>

            </xsd:element>

 

            Is there any corresponding xmlbeans extension for “jxb:property generateIsSetMethod=”true”/>” or attributes?

 

  1. JAXB version:

<xsd:element name="BrandID" type="xsd:int" minOccurs="0" maxOccurs="unbounded">

                        <xsd:annotation>

                                    <xsd:appinfo>

                                                <jxb:property name="brandIDs" collectionType="indexed"/>

                                    </xsd:appinfo>

                        </xsd:annotation>

            </xsd:element>

 

            Again is there any corresponding xmlbeans extension for: “<jxb:property name="brandIDs" collectionType="indexed"/>”

 

  1. JAXB version:

      <xsd:simpleType name="PartNumberConstants">

                  <xsd:annotation>

                              <xsd:appinfo>

                                          <jxb:typesafeEnumClass/>

                              </xsd:appinfo>

                  </xsd:annotation>

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

                              <xsd:enumeration value="INTERNAL"/>

                              <xsd:enumeration value="SKU"/>

                              <xsd:enumeration value="UPC"/>

                  </xsd:restriction>

      </xsd:simpleType>

 

      What’s the correponding xmlbeans extensions for: “<jxb:typesafeEnumClass/>” or is xmlbeans already has type safe enumeration build-in when you define an enumeration?

 

  1. JAXB version:

      <xsd:annotation>

                  <xsd:appinfo>

                              <jxb:globalBindings fixedAttributeAsConstantProperty="true" collectionType="java.util.ArrayList"/>

                              <jxb:schemaBindings>

                                          <jxb:package name="com.starcomsoft.growernetwork.binding.availability"/>

                              </jxb:schemaBindings>

                  </xsd:appinfo>

      </xsd:annotation>

 

      I don’t understand the meaning of “<jxb:globalBindings fixedAttributeAsConstantProperty="true" collectionType="java.util.ArrayList"/>”.  I’ve read the JAXB tutorial and still don’t fully grasp the meaning of this one.  From what I know it looks like when an element is an enumeration/sets the generated Java classes will return an instance of ArrayList instead of array[].  Is there any corresponding xmlbean extension/attributes or custom binding for it?

 

  1. JAXB version:

      <xsd:simpleType name="CustomDate">

                  <xsd:annotation>

                              <xsd:appinfo>

                                          <jxb:javaType name="com.starcomsoft.growernetwork.connect.messaging.CustomDate" parseMethod="fromString" printMethod="toString"/>

                              </xsd:appinfo>

                  </xsd:annotation>

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

                              <xsd:length value="10"/>

                              <xsd:pattern value="\d{4}-\d{2}-\d{2}"/>

                  </xsd:restriction>

      </xsd:simpleType>

 

 

This one jaxb provides a custom binding for a type “CustomDate” and will call the custom java class handler to process the data.  How would I implement this in xmlbeans?

 

 

Any help or suggestions are greatly appreciated and also thank you in advance for all your help.

 

Jun Victorio

 

Reply via email to