I thought I had created a minimized test case to show the problem, but
today that test seems to work, so I'll have to start over. Maybe an
element mapping isn't the solution.
Basically, the problem is that I have a namespace A with lots of types
and elements and a namespace B with extensions of the types/elements
(substitutiongroups) in A. When Marshalling classes in the B namespace,
the children defined in the A namespace (in the extended base type) are
prefixed, even though both Schemas are elementFormDefault="unqualified".
That is, I get
<b:subType>
<a:child>...</a:child>
rather than
<b:subType>
<child>...</child>
So Castor cannot unmarshall the XML that it has marshalled.
My workaround right now is to output to (J)DOM and remove the namespace
recursively. Not very pretty...
I'll get back if I manage to minimize the example.
/Mattias
Werner Guttmann wrote (2008-03-11 21:49):
Matthias,
rather than looking for a solution/reply to your first question, I'd
like to know more about what the problem is with the incorrect namespace.
Werner
Mattias Jiderhamn wrote:
Should I be able to use an elementBinding/java-class to map an
element to a class, while having defaultBindingType="type" for the
mapping file???
What I want to do is generate classes for all complex type plus one
particular element...
((This, in turn, is because the complex type class do not marshall
namespaces correctly when the schema is
elementFormDefault="unqualified"))
/Mattias
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email