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

Discussion in 'XML' started by gimme_this_gimme_that@yahoo.com, Jun 14, 2007.

  1. Guest

    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, 2007
    #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. asd
    Replies:
    3
    Views:
    440
    Arnaud Berger
    May 23, 2005
  2. gavnosis
    Replies:
    0
    Views:
    523
    gavnosis
    Aug 2, 2003
  3. Replies:
    5
    Views:
    485
    bouton
    Sep 22, 2005
  4. Replies:
    3
    Views:
    330
  5. Replies:
    0
    Views:
    104
Loading...

Share This Page