How to get missing namespace-declaration into derived elements?

Christoph Nölke <[email protected]>
Newsgroups gmane.text.xml.xmlbeans.user
Message-ID <[email protected]>
Hi folks,

I'm using XMLBeans 2.4 and encountered a validation issue because of a missing namespace definition on element level.

I defined an abstract base type "operator" in "schema.common". In that schema there is another complex type "master" which contains some elements of type "operator".
In schema "schema.coolops" I defined derivations of that abstract "operator" type using extension. "schema.coolops" of course imports "schema.common".
(Don't worry about the structure - it's just an excerpt of a complex system ;-))

For adding concrete "operator"s to "master" I coded
  Master.addNewOperator().changeType(schema.coolops.AddOperator.type)
which returns me a concrete "operator" instance.

Upto here all works fine. I can save/load the XML BUT several XML validators (except XMLBeans) claim
cvc-elt.4.2: Cannot resolve 'cops:AddOperator' to a type definition for element 'Operator'.

The XML looks like this:
<application xsi:schemaLocation="application http://example.org/application.xsd" xmlns="application" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:com="schema.common">
  <com:master>
    <com:operator xsi:type="cops:AddOperator" xmlns:cops="schema.coolops">
      ...
    </com:operator>
  </com:master>
</application>

If I add
  xsi:schemaLocation="schema.coolops http://example.org/schema.coolops.xsd"
to the element "com:operator" it is declared to be valid.

Any ideas/hints/... how to get this "schemaLocation" set?

Thanks a lot.
Christoph
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.