Skip to main content
Jump to: navigation, search




Provide support for XML any collection mapping configuration via XML metadata file.

The following should be configurable:


Basic XML any collection mapping support

We will extend our current xml-any-element support to allow any mapping configuration. We will need to modify the XSD such that xml-path, xml-access-methods, read-only, etc. can be set on xml-any-element. For example, the following XML metadata snippet would be used to setup an any collection mapping for 'stuff', where the stuff attribute is a List:

<xml-any-element java-attribute="stuff" />

If stuff was to be mapped to junk/stuff, then the following would be used:

<xml-any-element java-attribute="stuff" xml-path="things/junk/stuff" />

Read Only

The following demonstrates how an xml-any-element can be set as read-only:

<xml-any-element java-attribute="stuff" xml-path="things/junk/stuff" read-only="true" />

Write Only

The following demonstrates how an xml-any-element can be set as write-only:

<xml-any-element java-attribute="stuff" xml-path="things/junk/stuff" write-only="true" />

Equivalent annotations

public List<Object> stuff;


The following example will demonstrate how to configure XML any collection mappings via XML metadata by using xml-any-element.

package org.example;
public class Employee {
    public List<Object> stuff;
    public List<Object> getStuff() {
        return stuff;
    public void setStuff(List<Object> stuff) {
        this.stuff = stuff;

Deployment XML

<class-mapping-descriptor xsi:type="xml-class-mapping-descriptor">
    <attribute-mapping xsi:type="xml-any-collection-mapping">
      <field name="things/junk/s:stuff" xsi:type="node"/>
      <container xsi:type="list-container-policy">
  <default-root-element-field name="employee"/>

XML Instance Document

<?xml version="1.0" encoding="UTF-8"?>
<employee xmlns:s="">
      <s:stuff>Some Stuff</s:stuff>


This XML file demonstrates configuring XML any object mappings on the "org.example.Employee" class.

<?xml version="1.0" encoding="US-ASCII"?>
<xml-bindings xmlns="">
        <xml-ns namespace-uri="" prefix="s"/>
        <java-type name="org.example.Employee">
            <xml-root-element name="employee" />
                <xml-any-element java-attribute="stuff" xml-path="things/junk/s:stuff" xml-mixed="true">
                    <xml-access-methods get-method="getStuff" set-method="setStuff" />

Open Issues

This section lists the open issues that are still pending that must be decided prior to fully implementing this project's requirements.

Issue# Owner Description/Notes


This section lists decisions made. These are intended to document the resolution of open issues or constraints added to the project that are important.

Issue# Description/Notes Decision

Back to the top