users@jaxb.java.net

Re: Dealing with "any" elements

From: Robert Lowe <rmlowe_at_rmlowe.com>
Date: Wed, 02 Apr 2003 15:05:28 +0800

You can only put the classes in a different package if the elements/types
are in a different namespace. It's not possible to split a single namespace
into multiple packages.


----- Original Message -----
From: "joe user" <palehaole_at_yahoo.com>
To: <JAXB-INTEREST_at_JAVA.SUN.COM>
Sent: Wednesday, April 02, 2003 1:21 PM
Subject: Dealing with "any" elements


> Hello Jaxbers (how do you pronounce "jaxb", btw?),
>
> I am working on using JAXB to bind some XML schema for
> a protocol which unfortunately has some sections like
> this:
>
> <complexType name="readWriteType">
> <sequence>
> <any namespace="##other"/>
> </sequence>
> </complexType>
>
> JAXB doesn't support binding an "any" element; if I
> try to get that element, I get null. So what I need
> to do is replace that part of the protocol with
> <sequence><choice>....</choice></sequence>, where I
> put the real element types in there. In actual
> practice, only three different types are ever used in
> the <any> section.
>
> So I put those in, and the files are there, but the
> files have the same names for some of their types,
> which causes class name collisions.
>
> It seems like I should be able to fix this by
> annotating these files like this:
>
> <appinfo>
> <jxb:schemaBindings><jxb:package
> name="com.foo.otherschemapackage"/></jxb:schemaBindings>
> </appinfo>
>
> to get that particular file all into the
> com.foo.otherschemapackage package. But that seems to
> have no effect. I still get class name collisions.
>
> Any sugestions on how to prevent class name
> collisions, or how to handle this problem with "any"?
>
> Thanks!
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - File online, calculators, forms, and more
> http://tax.yahoo.com