performance of importNode

Discussion in 'XML' started by Andy Fish, Nov 4, 2003.

  1. Andy Fish

    Andy Fish Guest

    Hi,

    I have server-based Java application that maintains a fairly large XML
    structure as a DOM. In response to a user request I want to select various
    nodes (including sub-nodes) and jam them together to be returned as a new
    piece of XML. This is run through an XSLT transform to produce (typically)
    an HTML page.

    From what I can see, the obvious way to do it is to make a brand new XML
    document for each user response and then use Document.importNode (with
    deep=true). to copy all the selected nodes across into it. The nodes
    themselves are not large (including sub-nodes) but there may be 100 or so of
    them, so 100 calls to importNode for a single user request.

    Does anyone have any feel for whether this is a really inefficient thing to
    do? I haven't suffered any performance problems yet but the name of the
    function 'import node' gives the impression that a lot of work is going on
    behind the scenes. I realise I haven't been specific about performance
    requirements but this is potentially an 'enterprise scalable' application so
    I want to avoid doing anything really stupid.

    Ideally I would like to be able to just string together pointers to the
    selected nodes without having to copy anything, and then run the transform
    on that, but I can't see a way of doing that without building a new XML
    document.

    Many thanks in advance for any advice

    Andy
    Andy Fish, Nov 4, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    1,013
    Martin Honnen
    Dec 20, 2006
  2. Simon Brooke
    Replies:
    10
    Views:
    1,115
    Joe Kesselman
    Mar 17, 2007
  3. yawnmoth

    unable to get importNode working

    yawnmoth, Aug 22, 2006, in forum: Javascript
    Replies:
    5
    Views:
    118
    Martin Honnen
    Aug 23, 2006
  4. importNode Vs createNode

    , Jul 15, 2007, in forum: Javascript
    Replies:
    5
    Views:
    178
  5. Une Bévue

    importNode and root node name

    Une Bévue, Apr 26, 2008, in forum: Javascript
    Replies:
    11
    Views:
    207
    Une Bévue
    Apr 26, 2008
Loading...

Share This Page