You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Johannes Echterhoff <Jo...@gmx.de> on 2005/09/06 13:44:51 UTC
Child to add is from another document
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: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org