andreathedove Posted March 3, 2007 Share Posted March 3, 2007 Hello,how are you ?Help me please ... I have this Node:<link rel="alternate" type="text/html" href="http://www.lastampa.it/redazione/cmsSezioni/politica/200703articoli/18786girata.asp" /> To read the link http://www.lastampa.it/redazione/cmsSezion...18786girata.asp I try:Set col = xmldom.getElementsByTagName("entry/link[@href=]")But don't work why?Thanks,Andrea Link to comment Share on other sites More sharing options...
boen_robot Posted March 3, 2007 Share Posted March 3, 2007 You can't embed XPath expressions in JavaScript... at least not in this way. You'll have to traverse the DOM tree by the usage of the DOM objects. xmldom.getElementsByTagName("link") is equivalent to //link You need to then filter the result of that to whatever you need. I think this should get the value of the first link's href attribute: xmldom.getElementsByTagName("link")[0].getAttribute('href'); Link to comment Share on other sites More sharing options...
andreathedove Posted March 11, 2007 Author Share Posted March 11, 2007 Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now