You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by mi...@consult.nordea.com on 2006/04/06 09:48:06 UTC

Setting locale on XmlObject

Hi.

I think I need help to understand this.

When I write this:

XmlObject toc_lvl1 = cursor.getObject();
Node node = toc_lvl1.getDomNode().cloneNode( true );

XmlObject toc_sect = XmlObject.Factory.newInstance();
XmlCursor c1 = toc_sect.newCursor();
c1.toNextToken();
c1.beginElement( "sect" );
c1.toFirstChild();
c1.getDomNode().appendChild( node );

I get a:
WrongDocumentErr: Child to add is from another document.

The exception is raised from org.apache.xmlbeans.impl.store.DomImpl._node_insert_before
and is because the
(nc = (Dom) newChild).locale() != l

meaning that the newchild that I'm trying to append to toc_sect has a different locale than toc_lvl1.
Is it possible to set the locale for toc_sect to the same as the one for toc_lvl1?
Would that solve my problem?

Thanks for any input.

/Mikael

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org