Hi.
I just tried to put the contents of one document into the any-element of another document. I got following error:

org.apache.xmlbeans.impl.store.DomImpl$WrongDocumentErr: Child to add is from another document at org.apache.xmlbeans.impl.store.DomImpl._node_insertBefore(DomImpl.java:1756) at org.apache.xmlbeans.impl.store.Xobj$NodeXobj.insertBefore(Xobj.java:2459)
   at test.XMLBeansANYTest.main(XMLBeansANYTest.java:56)


The programs main-code looks like this:

       AMTargetConfigurationDocument atcd = null;
       try {
           atcd = AMTargetConfigurationDocument.Factory.newInstance();
           AMTargetConfiguration atc = atcd.addNewAMTargetConfiguration();
           Node configNode = atc.getDomNode();
AXISConnectorConfigDocument accd = AXISConnectorConfigDocument.Factory.newInstance();
           AXISConnectorConfigType acct = accd.addNewAXISConnectorConfig();
configNode.insertBefore(acct.getDomNode(),null); } catch (Exception e) {
           e.printStackTrace();
       }
       System.out.println(atcd.toString());



The schema for AMTargetConfiguration looks like this:

<xs:element name="AMTargetConfiguration"> <xs:complexType>
           <xs:sequence>
               <xs:any processContents="skip"/>
           </xs:sequence>
       </xs:complexType>
   </xs:element>


I had a look at docs/guide/conHandlingAny.html but still do not get the clue. Can someone please tell me what this error means and how to solve it?

Regards,
   Johannes Echterhoff




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to