Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-dev] MOXy Metadata Design: xml-any-element with xml-element-ref(s)

Hi David,

Looks good, however what does it mean if a user tries to specify a name in the nested xml-element-refs element?:

<?xml version="1.0" encoding="US-ASCII"?>
<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm">
   <java-types>
      <java-type name="org.example.Employee">
         <xml-root-element name="emp" />
         <java-attributes>
            <xml-any-element java-attribute="stuff">
               <xml-element-refs name="FOO">
                  <xml-element-ref java-attribute="a" type="java.lang.String" />
                  <xml-element-ref java-attribute="b" type="java.lang.Integer" />
               </xml-element-refs>
            </xml-any-element>
         </java-attributes>
      </java-type>
   </java-types>
</xml-bindings>


-Blaise

David McCann wrote:
All,

In order to support use of xml-any-element with xml-element-ref(s), the OXM metadata schema will be modified such that an xml-any-element declaration can have an xml-element-refs sub element.  Here's an example of how this can be configured via eclipselink-oxm.xml
:
<?xml version="1.0" encoding="US-ASCII"?>
<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm">
   <java-types>
      <java-type name="org.example.Employee">
         <xml-root-element name="emp" />
         <java-attributes>
            <xml-any-element java-attribute="stuff">
               <xml-element-refs>
                  <xml-element-ref java-attribute="a" type="java.lang.String" />
                  <xml-element-ref java-attribute="b" type="java.lang.Integer" />
               </xml-element-refs>
            </xml-any-element>
         </java-attributes>
      </java-type>
   </java-types>
</xml-bindings>

A example of an instance document:
<?xml version="1.0" encoding="UTF-8"?>
<emp xmlns:ns0="otherns">
   <a>66</a>
   <b>99</b>
  
<ns0:bar><id>i69</id></ns0:bar>
</emp>

The design page for Phase 4 has been updated to include information on this additional support.  Please feel free to provide any feedback you may have.

Cheers.

--
Oracle
David McCann | Principal Software Engineer | +6132884636
Oracle Server Technologies, EclipseLink Product
ORACLE Canada | 45 O'Connor St., Suite 400 | Ottawa, Ontario | K1P 1A4
Green Oracle Oracle is committed to developing practices and products that help protect the environment

_______________________________________________ eclipselink-dev mailing list eclipselink-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/eclipselink-dev

Back to the top