users@jaxb.java.net

Forcing lax=true in _at_XmlAnyElement

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Tue, 16 Feb 2010 13:45:47 +0100

Hi,

I have a following schema fragment:

        <complexType name="ComplexDataType" mixed="true">
                <annotation>
                        <documentation>Complex data (such as an image), including a
definition of the complex value data structure (i.e., schema, format,
and encoding). May be an ows:Manifest data structure.</documentation>
                </annotation>
                <complexContent mixed="true">
                        <extension base="anyType">
                                <attributeGroup ref="wps:ComplexDataEncoding"/>
                        </extension>
                </complexContent>
        </complexType>

XJC generates the following content property for the content of this type:

    @XmlMixed
    @XmlAnyElement
    protected List<Object> content;

    public List<Object> getContent() {
        if (content == null) {
            content = new ArrayList<Object>();
        }
        return this.content;
    }

Note the @XmlAnyElement without any attributes.

What I need is a lax-ed @XmlAnyElement there:

    @XmlMixed
    @XmlAnyElement(lax=true)
    protected List<Object> content;

My question is: is there any possibility to customize this property so
that it gets lax=true in @XmlAnyElement definition?

If not, I'll write a plugin for that - but I don't want to make useless work.

Thank you for your time!

Bye,
/lexi