selecting nodes using an attribute?

admin

Administrator
Staff member
Hello, I am trying to use javascript to go through an xml file and select/display nodes based on a date attribute found in each node. My xml-related question is, how would you extract this attribute in a cross-browser-friendly way? If each entry were:

<entry>
<data date="20061004">October 4, 2006</date>
</entry>

And I was using a loop to check each entry's date attribute and select entries which were within 10 days of the current date (using getDate), how would you reference the attribute value in the XML file? I believe I can resolve the javascript side of comparing values, I'm just trying to figure out how to assign that attribute value to a variable.

I aplogize if this is the wrong place to ask or if do not make sense. :( Thank you for your assistance!
 
Back
Top