Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Is there a tool to get names and values of XHTML Nodes ?

Reply
Thread Tools

Is there a tool to get names and values of XHTML Nodes ?

 
 
gimme_this_gimme_that@yahoo.com
Guest
Posts: n/a
 
      06-14-2007
I have an XHTML page which has divs whose contents I want to change
dynamically based upon cookie settings.

Say, this would be the XHTML ...

<div id="_nav" class="help-links" >
<ul>
<li><a id="_search" href="">Search</a></li>
</ul>
</div>

And this would be Javascript that dynamically changes the value of a
link on the page:

function setSearchLink() {
var fn = document.getElementById("_search")
var user_type = getCookieData("UserType");
if (user_type) {
if ("LikesYahoo" == emp_type) {
fn.childNodes[0].data = "Yahoo";
fn.attributes["href"].nodeValue = "http://www.yahoo.com";
} else {
fn.childNodes[0].data = "Google";
fn.attribues["href"].nodeValue = "http://www.google.com";
}
}
}

I'm having trouble isolating element data values and attribute values.
It's kind of hit and miss.

Is there a tool that allows me to me load an XHTML file, lets me to
click on the HTML ( say around the Search element or the href
attribute ) and then shows me the XPath of what I just clicked?

In the above example, I'd like to refer to things from the id "_nav"
instead of from "_search".

Thanks.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a tool to get names and values of XHTML Nodes ? gimme_this_gimme_that@yahoo.com Javascript 0 06-14-2007 01:02 AM
looping through names of nodes and sub nodes k.a.bouton@reading.ac.uk XML 5 09-22-2005 04:02 PM
Text nodes and element nodes query asd Java 3 05-23-2005 10:01 AM
selecting nodes between other nodes Timo Nentwig XML 1 06-17-2004 04:54 AM
Reality check: Is it sensible to link XML nodes to other XML nodes in the same file? gavnosis XML 0 08-02-2003 08:22 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57