users@jaxb.java.net

Namespace usage and xsd:any element problem

From: Fernando González <fergonco_at_gmail.com>
Date: Sat, 23 Aug 2008 11:56:15 +0200

Hi,

I'm using JAXB to generate XML using different context directories as
context path and I'm having a strange behavior. The application I'm building
reads and writes XML fine, but I get no namespace prefix in the XML.
However, when I run the same code from an unit test it generates XML's with
namespace prefix in some of nodes (corresponding to a "any" element in the
schema). As a result, test cases cannot map the XML files produced by the
application to the objects JAXB generated but to a default NSElement (I
think it's something from the parser). The context path is identical in both
cases.

I would like to know which is the JAXB policy for namespace usage. Any hint
would be appreciated.

Greetings,
Fernando