I have an element with an explicit namespace via @XmlElement in JAXB.
Whomever built the XmlSchemaElement for it has not filled in the qname,
only the name.

The exact situation is more puzzling, and perhaps I am about to propose
the solution.

@XmlElement(namespace = "uri:hello.sailor")
int intValue;

The element in the complex type has a name (intValue) but no qname. It
has a refName that points to {uri:hello.sailor}intValue.

So, it looks like I should be constructing the XML in serialization from
the refName, not from the name.

My intuition always gets me in trouble with JAXB, but is it really true
that the @XmlElement above officially calls forth a root element in the
specified namespace with that name, and any conflicts (like some other
declaration that tried to use the same name with a different type) would
be an error?

Reply via email to