<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 5.00.2314.1000" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#0000ff face="Comic Sans MS" size=2><SPAN
class=713402613-21101999><STRONG>Hi Prakash,</STRONG></SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face="Comic Sans MS" size=2><SPAN
class=713402613-21101999></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face="Comic Sans MS" size=2><SPAN
class=713402613-21101999><STRONG>I have also experiences the
same problem. But I am using the sun XML-TR2 release as XML Parser.
The solution to this problem is to use changeNodeOwner() API on DocumentEx
(extension of Document interface) provided in sun's implementation. You can call
this API on your Document (which has the root node, where you want to append
nodes obtained from XPath Query) object and pass the node from XPath as
parameter to this API. After that if you append these nodes, it will
work.</STRONG></SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face="Comic Sans MS" size=2><SPAN
class=713402613-21101999></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face="Comic Sans MS" size=2><SPAN
class=713402613-21101999><STRONG>DOM Level 1 APIs doesn't have this support
defined in the spec. But DOM Level 2 spec has an API importNode() which I guess,
is what we need in this problem. I don't know if any XML Parser with DOM Level 2
support is available as of now.</STRONG></SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#0000ff face="Comic Sans MS" size=2><SPAN
class=713402613-21101999><STRONG>Try using sun's XML
Parser.</STRONG></SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#0000ff face="Comic Sans MS" size=2><SPAN
class=713402613-21101999><STRONG>Cheers,</STRONG></SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face="Comic Sans MS" size=2><SPAN
class=713402613-21101999><STRONG>Sanjeev</STRONG></SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face="Comic Sans MS" size=2><SPAN
class=713402613-21101999></SPAN></FONT><FONT face=Tahoma size=2>-----Original
Message-----<BR><B>From:</B> Prakash Mandgi
[mailto:pmandgi@hotmail.com]<BR><B>Sent:</B> Thursday, October 21, 1999 1:47
AM<BR><B>To:</B> xml-dev@ic.ac.uk<BR><B>Subject:</B> XML Implementation in IBM
XML4J2_0_15 parser with XPath<BR><BR></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px"></FONT>
<DIV><FONT size=2>Hi All,</FONT></DIV>
<DIV><FONT size=2> I am running into a problem using the
lotus XSL XPath implementation on IBM XML4J2_0_15. </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Problem:</FONT></DIV>
<DIV><FONT size=2>I have an rmi service</FONT><FONT size=2> which basically
takes and XPath string ( query string ), runs it across a persisted DOM
object, which is retrieved from</FONT><FONT size=2> the object database, and
returns a document fragment back. The problem i am running into is creating a
new document object of which the root element is the document fragment. I am
trying to append to this root node, the nodes obtained from the XPath query.
Unfortunately the implementation of IBM parsers is that it compares
the</FONT><FONT size=2> nodes owner document with that of the element under
which i need to insert the nodes. If the owner document are not the same, as
it is my case, it will not allow you to append a child.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>Questions:</FONT></DIV>
<DIV><FONT size=2>Is this a DOM thingie or is it at an IBM implementation
feature.</FONT></DIV>
<DIV><FONT size=2>Does any one have a way to work around this problem without
cloning the document, which can be fairly large, and then
creating a document fragment which has the Node
list embedded within it.</FONT></DIV>
<DIV><FONT size=2>Is there a better implementation than
that IBM parser, with source code ;-) which has
the following features</FONT></DIV>
<DIV><FONT size=2> - XPath integration</FONT></DIV>
<DIV><FONT size=2> - XML TreeDiff to find out
the difference between two dom documents and then merging the
two.</FONT></DIV>
<DIV><FONT size=2>Has any one implemented DOM with copy constructors for the
node impl etc objects ( I know its a C++ feature</FONT></DIV>
<DIV><FONT size=2>but it makes life much simpler ;-) )</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>Other </FONT></DIV>
<DIV><FONT size=2>-- Java 1.2 implementation</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>Regards</FONT></DIV>
<DIV><FONT size=2>Prakash </FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>- Need the entire source code in java
</FONT> </DIV></BLOCKQUOTE></BODY></HTML>