473,383 Members | 1,788 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,383 software developers and data experts.

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

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.

Jun 14 '07 #1
0 1129

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

Similar topics

4
by: Tristan Miller | last post by:
Greetings. I would like to produce a static multilingual website in XHTML. Is it possible to specify each web page in its own XML file, but have all of the translations encapsulated in that one...
1
by: Gordon - Adelphia | last post by:
I have a question regarding xhtml. Why, why, why does the ELEMENT <body> allow “unblocked” text. HTML does not (though, most browsers will render). Xhtml (transitional) however allows text nodes...
8
by: David Dorward | last post by:
I'm looking for an XSLT that I can use to transform XHTML 1.0 Strict into HTML 4.01. Does anyone know of a nice prewritten one? -- David Dorward ...
22
by: gabon | last post by:
Hi guys, I'm facing the bug about the failure of innterHTML while reading xhtml content inside a DIV, in fact it has passed as html removing the closing of some nodes. Is there a way to read the...
1
by: Lore Leunoeg | last post by:
Hello Can I parse an XHTML Document with XPath? I tried the following expressions with the following XHTML Document with n o result: Removing the doctype and the namespace (xmlns) statemens...
10
by: webEater | last post by:
Hello, I try the following in Firefox and other modern browsers: window.addEventListener('load', function() { document.title = CSS.getClass('fontSize'); var div = document.createElement('div');...
2
by: SMH | last post by:
I am in the process of converting all HTML documents, including many dynamic/interactive documents, to XHTML documents (because I want to incorporate SVG and MathML, among other things). I am...
1
by: TamusJRoyce | last post by:
I have xsl code which I was hoping could be used to replace one specific tag from an xhtml document and output another xhtml document. xsl has phenomenal potential in data replacing, but coming...
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
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.