Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need xml help

Status
Not open for further replies.

radiovezadotorg

Programmer
Jan 13, 2009
1
Hello,

I'm new to this forum and to programming.

I need to extract data and publish to html from following xml document:

<Schedule System="Jazler">
<Event status="happening" startTime="00:19:09" eventType="song">
<Announcement Display="Now On Air:"/>
<Song title="testa matta ">
<Artist name="filji di bruno atomiko ">
<Media runTime="143.148"/>
<Expire Time="00:21:32"/>
</Artist>
</Song>
</Event>
</Schedule>


Can someone write me simple script to extract (i need to write it to html doc):

Event -> status
Event -> startTime
Event -> startTime
Announcement -> Display
Song -> title
Artist -> name
Media -> runTime
Expire -> Time

Person who will first provide a working solution, will gain permanent pr5 and pr4 links from domains in my sig.

 
Try this:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform"[/URL] xmlns:fo="[URL unfurl="true"]http://www.w3.org/1999/XSL/Format">[/URL]

<xsl:template match="/">
	<html>
		<head>
			<title></title>
		</head>
		<body>
			Event Status is: <xsl:value-of select="Schedule/Event/@status"/><br/>
			Event Start Time is: <xsl:value-of select="Schedule/Event/@startTime"/><br/>
			Event Announcement is: <xsl:value-of select="Schedule/Event/Announcement/@Display"/><br/>
			Song Title is: <xsl:value-of select="Schedule/Event/Song/@title"/><br/>
			Artist Name is: <xsl:value-of select="Schedule/Event/Song/Artist/@name"/><br/>
			Media is: <xsl:value-of select="Schedule/Event/Song/Artist/Media/@runTime"/><br/>
			Runtime is: <xsl:value-of select="Schedule/Event/Song/Artist/Expire/@Time"/><br/>
		</body>
	</html>
	
</xsl:template>

</xsl:stylesheet>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top