Re: XML: copy childNodes from one document to another?
From: lb (asas_at_rt.h)
Date: 04/28/04
- Next message: Rob Shepherd: "Re: Pausing Threads From Events"
- Previous message: Josef Garvi: "Re: MVC pattern"
- In reply to: Martin Honnen: "Re: XML: copy childNodes from one document to another?"
- Next in thread: TechBookReport: "Re: XML: copy childNodes from one document to another?"
- Reply: TechBookReport: "Re: XML: copy childNodes from one document to another?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 28 Apr 2004 13:47:44 +0200
"Martin Honnen" <mahotrash@yahoo.de> skrev i en meddelelse
news:408f8f39$0$26354$9b4e6d93@newsread4.arcor-online.net...
>
> You could first copy the nodes into a DocumentFragment and then
> insert/append that. However with 20000 nodes I wonder whether DOM is a
> good solution at all, you might be better off with some SAX processing
>
Thanks for the suggestions. I have to think of an alternative since Oracle's
parses doesn't seem to be able to handle large numbers of nodes.
Example (see end) where results2 holds about 3600 childNodes:
Node newResults1 = doc.importNode(results2, true);
results1.getParentNode().appendChild(newResults1);
Node newResults2 = doc.importNode(results2, true);
results1.getParentNode().appendChild(newResults2);
Node newResults3 = doc.importNode(results2, true);
results1.getParentNode().appendChild(newResults3);
I'm calling this in a struts action of a web application and during the
third importNode call, some kind of error occurs. When debugging there's no
exception.The instruction pointer just vanishes into thin air.
However, if I create a XML file containing the above and then load it, there
's no error. Although there could be other reasons, this little experiment
indicates that something is not working properly in the Oracle XML parser.
Lars
----------------------------------------------------------------------------
------------
In the experiment above I'm just appending results as siblings so the end
result should be:
<root>
<results>
<sections>
<section source="doc1"/>
<section source="doc1"/>
</sections>
</results>
<results>
<sections>
<section source="doc2"/>
<section source="doc2"/>
</sections>
</results>
<results>
<sections>
<section source="doc2"/>
<section source="doc2"/>
</sections>
</results>
<results>
<sections>
<section source="doc2"/>
<section source="doc2"/>
</sections>
</results>
</root>
- Next message: Rob Shepherd: "Re: Pausing Threads From Events"
- Previous message: Josef Garvi: "Re: MVC pattern"
- In reply to: Martin Honnen: "Re: XML: copy childNodes from one document to another?"
- Next in thread: TechBookReport: "Re: XML: copy childNodes from one document to another?"
- Reply: TechBookReport: "Re: XML: copy childNodes from one document to another?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|