/    Sign up×
Community /Pin to ProfileBookmark

Help reading multiple values from XML

Hello,
Im having trouble reading more than one tag at a time from my XML file. Basically I want the javascript to filter through the XML using a for loop or a while loop.. I’ve tried both but my logic must had been flawed somewhere… here is the simple code I have.

[code=php]
<script>
var xmlDoc = new ActiveXObject(“Microsoft.XMLDOM”)
xmlDoc.async=”false”
xmlDoc.load(“RSSFeed.xml”)
document.write(xmlDoc.getElementsByTagName(“pubdate”).item(1).text);
document.write(” – “);
document.write(xmlDoc.getElementsByTagName(“description”).item(1).text);S
</script>
[/code]

So I basically want some type of loop to pull all of those values I specified above in the code (pubdate and Description) Thanks for your help I really appreciate it.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@KorOct 17.2006 — DOM will help you. Google for DOM XML
×

Success!

Help @blckspder spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...