473,378 Members | 1,236 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Does anyone do DOM navigation anymore?

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?!
Jul 20 '05 #1
2 1386


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/

Jul 20 '05 #2
Derek Fountain <no****@example.com> wrote in message news:<40***********************@per-qv1-newsreader-01.iinet.net.au>...
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.
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

162
by: Isaac Grover | last post by:
Hi everyone, Just out of curiosity I recently pointed one of my hand-typed pages at the W3 Validator, and my hand-typed code was just ripped to shreds. Then I pointed some major sites...
6
by: anon | last post by:
How *EXACTLY* does Smart Navigation work? (I would really really really like for this Smart Navigation to work in Mozilla.) The inner workings and the code is what I am looking for. Does it...
3
by: Dietmar Prantner | last post by:
Hello, I tried a Javascript on my homepage that works fine on Netscape, works nearlyx normal on Opera but does not work at all on Internet Explorer. Is there anybody out there who can help? I...
0
by: Veli-Pekka Tätilä | last post by:
Hi, My first post here. I've found some serious accessibility flaws in the Python 2.4 docs and wish they could be rectified over time. I'm very new to Python and initially contacted docs at python...
0
by: Marc Scheuner [MVP ADSI] | last post by:
Folks, I'm trying to get a grip on customizing my WebBrowser control hosted on a WinForms form. I've come as far as finding out about IDocHostUIHandler, and I've implemented the...
1
by: Sal | last post by:
Greetings to all... I have a simple asp.net app. It consists of three aspx pages. I have enabled smart navigation on the pages. The app runs smoothly on the developer machine, but when I upload...
13
by: alvin.yk | last post by:
Hi, Normally, a piece of code such as <a href="http://www.yahoo.com" onclick="alert('hello');return false;">link</a> will stop the browser from actually going to href's destination....
12
by: -Lost | last post by:
Sorry, for two separate browser questions, but I figured a multi-post about the same URL might not get favorable results. I am making a little website for the daycare my mother and wife works at...
1
by: jochemdu | last post by:
Hi All, I made a little script a while ago and it worked but now my hosting provider changed some PHP settings on the server, they enabled safe mode and now i have to switch to CURL. When...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.