Jump to content

How I can ?


andreathedove

Recommended Posts

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

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

  • 2 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...