users@jaxb.java.net

can someone help me understand namespaces in the context of (un)marshalling?

From: jon gold <dev_at_samizdatdigital.org>
Date: Thu, 17 Feb 2005 10:42:06 -0800

i'm having a lot of trouble lately trying to unmarshal documents, and
also not fully understanding the results of marshalling.

trying to unmarshal
        
<?xml version="1.0"?>
<foo xmlns="http://somens">
        <bar>...</bar>
        ...
</foo>

fails with 'unexpected element {http://somens}:bar', but succeeds when
the document contains

        <bar xmlns="">...</bar>

i'm playing around with putting some debugging in the visit method of
the Unmarshaller from the source drop, and have found that, if i build
the dom by hand and use createElementNS to create the root, but use just
plain createElement for the others, then the document (which would look
like the first version) will unmarshal okay. on the other hand, if i use
DocumentBuilder.parse on a similar document and pass it in to unmarshal,
it's not seeming to parse that way (i've set namespace aware to true or
false, and of course false is not what i want -- the root is not even
recognized). does anyone have an idea of what it is i want to be
happening? i feel like there is probably a flag or a property somewhere
that i should be setting, but it's not clear what that is.

jon

PS: the jaxb archive search is still only returning this month's results
for me.