/    Sign up×
Community /Pin to ProfileBookmark

How to add xml to html

I found this code on w3schools.com. This insert xml infos to html.

[CODE]<script type=”text/javascript”>
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject(“Microsoft.XMLHTTP”);
}
xmlhttp.open(“GET”,”http://www.w3schools.com/XML/cd_catalog.xml”,false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;

document.write(“<table border=’1′>”);
var x=xmlDoc.getElementsByTagName(“CD”);
for (i=0;i<x.length;i++)
{
document.write(“<tr><td>”);
document.write(x[i].getElementsByTagName(“ARTIST”)[0].childNodes[0].nodeValue);
document.write(“</td><td>”);
document.write(x[i].getElementsByTagName(“TITLE”)[0].childNodes[0].nodeValue);
document.write(“</td></tr>”);
}
document.write(“</table>”);
</script>[/CODE]

My problem is that my xml is different. You can see my xml down and help me how to insert it in my page. I want only to display artist title and hour

[CODE]<Schedule System=”Jazler”>
<Event status=”happening” startTime=”10:54:56″ eventType=”song”>
<Announcement Display=”Now On Air:”/>
<Song title=”KRYPsE ME”>
<Artist name=”XATZHGIANNHS”>
<Media runTime=”183.837″/>
<Expire Time=”10:57:59″/>
</Artist>
</Song>

</Event>
</Schedule> [/CODE]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @dj_kostas_pro 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.19,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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