Does anyone do DOM navigation anymore?

Discussion in 'XML' started by Derek Fountain, Jul 6, 2004.

  1. I've spent the last few days tinkering with DOM trees and the DOM API. A
    couple of years back I wrote a fairly complex application which found the
    data it required using this nextSibling, firstChild, sort of navigation. I
    recall the development experience wasn't a terribly happy one, and I have
    always presumed that XPATH was largely invented to get past all this
    mucking about.

    So it occurs to me to ask: do people still use the original DOM style
    navigation? When is it preferable to XPATH? Why, in short, is the whole
    "document hopping" idea not deprecated?!
    Derek Fountain, Jul 6, 2004
    #1
    1. Advertising

  2. Derek Fountain wrote:

    > I've spent the last few days tinkering with DOM trees and the DOM API. A
    > couple of years back I wrote a fairly complex application which found the
    > data it required using this nextSibling, firstChild, sort of navigation. I
    > recall the development experience wasn't a terribly happy one, and I have
    > always presumed that XPATH was largely invented to get past all this
    > mucking about.
    >
    > So it occurs to me to ask: do people still use the original DOM style
    > navigation? When is it preferable to XPATH? Why, in short, is the whole
    > "document hopping" idea not deprecated?!


    DOM contrary to XPath not only allows navigating the document but also
    changing it (you can add nodes, delete nodes, move nodes etc.). And
    often you have only a DOM core implementation and no XPath available. Of
    course if you have XPath on top of or in addition to DOM then it is in
    most cases easier to navigate to a node with XPath.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jul 6, 2004
    #2
    1. Advertising

  3. Derek Fountain

    Andy Dingley Guest

    Derek Fountain <> wrote in message news:<40e9f199$0$24765$>...

    > So it occurs to me to ask: do people still use the original DOM style
    > navigation? When is it preferable to XPATH?


    XPath returns you a node set, nextSibling returns a node.
    Andy Dingley, Jul 6, 2004
    #3
    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. Eric Lilja
    Replies:
    4
    Views:
    471
  2. Doerte

    integrate does not work anymore

    Doerte, Mar 25, 2009, in forum: Python
    Replies:
    1
    Views:
    647
    Ulrich Eckhardt
    Mar 25, 2009
  3. Shao Miller

    Re: Does anyone play MUDs anymore?

    Shao Miller, Sep 14, 2010, in forum: C Programming
    Replies:
    2
    Views:
    312
    Keith Thompson
    Sep 14, 2010
  4. Default User

    Re: Does anyone play MUDs anymore?

    Default User, Sep 14, 2010, in forum: C Programming
    Replies:
    0
    Views:
    470
    Default User
    Sep 14, 2010
  5. Junkone
    Replies:
    2
    Views:
    137
    IƱaki Baz Castillo
    Aug 14, 2008
Loading...

Share This Page