Just to clarify, I want to be able to take a nested element (which is
referred to from a type and hence is not a top-level/global element) and
either (1) Make JiBX regard it as a top level element or (2) instruct
JiBX to create a marshaller for this nested element. Either way the end
goal is to just create a marshaller for this element, yet it seems this
is only possible for global/top-level elements...

 

From: Spivey, Jimmy (IS) (Contr) [mailto:jimmy.spi...@ngc.com] 
Sent: Tuesday, August 31, 2010 12:41 PM
To: jibx-users@lists.sourceforge.net
Subject: EXTERNAL:[jibx-users] Creating a marshaller for non-global
elements...?

 

We have a given XSD such as this:

 

      <xsd:element name="SomeRequest">

            <xsd:complexType>

                  <xsd:sequence>

 

                        <xsd:element name="RegistrationDetail"
type="RegistrationDetailType"

                              minOccurs="0" />

                  </xsd:sequence>

            </xsd:complexType>

      </xsd:element>

 

      <xsd:complexType name="RegistrationDetailType">

            <xsd:sequence>

                  <xsd:element name="Registration"
type="RegistrationType"

                        maxOccurs="unbounded" />

            </xsd:sequence>

      </xsd:complexType>

 

      <xsd:complexType name="RegistrationType">

            <xsd:sequence>

                  <xsd:element name="AnotherElem" type="AnotherType" />

                  <xsd:element name="YetAnotherElem"
type="YetAnotherType" />

            </xsd:sequence>

      </xsd:complexType>

 

 

We need this XSD to only have 1 global element, "SomeRequest"... And
every element nested in it must be a referenced type as is in the above
example. We are currently (and manually) taking the given XSD and
creating global elements so that we get a JiBX marshaller for say
"Registration" element. This is what we do manually:

 

      <xsd:element name="SomeRequest">

            <xsd:complexType>

                  <xsd:sequence>

                        <xsd:element name="RegistrationDetail"
type="RegistrationDetailType"

                              minOccurs="0" />

                  </xsd:sequence>

            </xsd:complexType>

      </xsd:element>

 

 

      <xsd:complexType name="RegistrationDetailType">

            <xsd:sequence>

                  <xsd:element ref="Registration" maxOccurs="unbounded"
/>

            </xsd:sequence>

      </xsd:complexType>

 

<!-- WORKAROUND: expose as a global element to obtain a marshaller and
unmarshaller -->

<xsd:element name="Registration">

      <xsd:complexType>

            <xsd:sequence>

                  <xsd:choice>

                        <xsd:element name="AnotherElem"
type="AnotherType" />

                        <xsd:element name="YetAnotherElem"
type="YetAnotherType" />

                  </xsd:choice>

            </xsd:sequence>

      </xsd:complexType>

</xsd:element>

 

We need this XSD to only have 1 global

Again we wish to keep the previous (the first example) XSD intact and
not remake these Types into global elements in order to get a JiBX
marshaller/unmarshaller.... Is there anything with Jibx customizations
or anything else that we can to obtain a marshaller for a non global
element?

 

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to