You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Benson Margulies <bi...@basistech.com> on 2007/10/31 14:20:16 UTC

XmlSchemaElement qname not set for qualified element

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?


RE: XmlSchemaElement qname not set for qualified element + form not set right

Posted by Benson Margulies <bi...@basistech.com>.
To answer part of my own question:

The result is 

@XmlElement(namespace = "")

The result of this, indeed, is to force an explicit prefix for the
current schema TNS.

> -----Original Message-----
> From: Benson Margulies [mailto:bim2007@basistech.com]
> Sent: Wednesday, October 31, 2007 9:27 AM
> To: cxf-dev@incubator.apache.org
> Cc: Daniel Kulp
> Subject: RE: XmlSchemaElement qname not set for qualified element +
form
> not set right
> 
> This thread concerns the construct:
> 
> @XmlElement(namespace = "some_other_namespace")
> int intValue;
> 
> Yesterday, Dan Kulp offered the idea (I thought) that this was the way
> to get a schema like:
> 
> <xsd:element form='qualified' ref='son:intValue' .../>
> 
> Sadly for me at the moment, I note that the form property of the
element
> is 'none', and so is the form property of the referenced element.
> 
> I can code the javascript generator to force qualification in this
case,
> but is this correct?
> 
> One possibility is that jaxb is just not interested in form= on
> elements, and only does qualification when it notices a schema
> disparity. This leads to interesting questions about what happens when
> you construct a WSDL/XSD that uses form='qualified' 'gratuitously', in
> terms of what annotations result.
> 

RE: XmlSchemaElement qname not set for qualified element + form not set right

Posted by Benson Margulies <bi...@basistech.com>.
This thread concerns the construct:

@XmlElement(namespace = "some_other_namespace")
int intValue;

Yesterday, Dan Kulp offered the idea (I thought) that this was the way
to get a schema like:

<xsd:element form='qualified' ref='son:intValue' .../>

Sadly for me at the moment, I note that the form property of the element
is 'none', and so is the form property of the referenced element. 

I can code the javascript generator to force qualification in this case,
but is this correct? 

One possibility is that jaxb is just not interested in form= on
elements, and only does qualification when it notices a schema
disparity. This leads to interesting questions about what happens when
you construct a WSDL/XSD that uses form='qualified' 'gratuitously', in
terms of what annotations result.