q: i'd like to merge two docs ...

Rajiv Mordani Rajiv.Mordani at eng.sun.com
Fri Dec 3 03:25:25 GMT 1999


You have the changeNodeOwner API in XmlDocument to actually do the
necessary so you don't get the error shown below. So before appending use
the changeNodeOwner and then you are all set.

- Rajiv

XML is to the 90s what ASCII was to the 70s

On Wed, 1 Dec 1999, James Todd wrote:

> 
> hi -
> 
>     i could use a pointer or two, a recipe if you will, on how best to
>     "modify and merge" two xml docs. the scenario:
> 
>         an inbound xml "fragment", a complete xml doc in it's own
>         right, is amended (eg. one new attribute is added)
> 
>         the results of which is appended, as a child node, to a
>         "hosting" xml tree
> 
>     i've got most of this working using the ProjectX [? Mr. Brownell ?]
>     parser yet it fails during the appendChild() stating that the child
> node
> 
>         "That node doesn't belong in this document"
> 
>     due to the fact, i believe, that it has a distinct OwnerDocument.
> 
>     my methodology to date is to create dom's for both the inbound
>     "fragment" and the destination xml docs afterwhich i'd like to
> modify
>     the fragment (hence going the dom route) and finally add the results
> 
>     to the destination doc via appendChild().
> 
>     i had hoped to bypass walking the tree in order to create an
>     "document ownerless" copy with which to work with. is there
>     a better/preferred means by which to accomplish this task?
> 
>     any/all comments and suggestions welcomed.
> 
>     thx much,
> 
> - james
> 
> 
> xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
> Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
> To unsubscribe, mailto:majordomo at ic.ac.uk the following message;
> unsubscribe xml-dev
> To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
> subscribe xml-dev-digest
> List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
> 
> 


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo at ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)





More information about the Xml-dev mailing list