Re: XML: copy childNodes from one document to another?

From: lb (asas_at_rt.h)
Date: 04/28/04


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>



Relevant Pages

  • Re: Another one cant wait to go
    ... skrev i en meddelelse ... Desperation Ted...oh why was it Paco left Liverpool? ...
    (uk.sport.football.clubs.liverpool)
  • Re: Off Topic, but need help
    ... skrev i en meddelelse ... > Troelsgaard wrote: ... >> On a code level, it's a windows.form containing all code - nothing is ...
    (sci.geo.geology)
  • Re: Was Yoko a Buddhist?
    ... skrev i en meddelelse ... Tom K wrote: ... Some "commentators" have viewed her early works (like Grapefruit) ...
    (rec.music.beatles)
  • Re: Is it possible to use wildcard characters in array formulas?
    ... "Harlan Grove" skrev i en meddelelse ... > provides more flexibility. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Data file on Internet
    ... "Anders Eriksson" skrev i en ... meddelelse news:140hn6ylkfco6.dlg@morateknikutveckling.se... ... > I'm creating an program that needs to have one of it's data files "on the ...
    (microsoft.public.vc.mfc)