|
|
|
#1 (permalink) | |||||||||||||
|
New to Overclock.net
|
I cannot seem to get each album and each of the 5 songs of all of the albums to display beneath the respective bands/albums. I've tried many different things and have spent quite a few hours working on this. For some reason only the first song will display for each album. Any help would be appreciated.
__________________XML File Code:
<?xml version ="1.0"?>
<?xml-stylesheet type ="text/xsl" href="Favorite_Music_2.xsl"?>
<?xml-stylesheet type ="application/xml" href="Favorite_Music_2.xsl"?>
<FAVORITEMUSIC>
<BAND BAND_NAME="Motley Crue">
<ALBUM ALBUM_NAME="Greatest Hits Package">
<SONG SONG_NAME="Live Wire"/>
<SONG SONG_NAME="Public Enemy #1"/>
<SONG SONG_NAME="Take Me To The Top"/>
<SONG SONG_NAME="Merry-Go-Round"/>
<SONG SONG_NAME="Piece Of Your Action"/>
<ALBUM PRICE="$19.99 USD"/>
<ALBUM ART=""/>
</ALBUM>
</BAND>
<BAND BAND_NAME="Daughtry">
<ALBUM ALBUM_NAME="Leave This Town">
<SONG SONG_NAME="You Don't Belong"/>
<SONG SONG_NAME="No Surprise"/>
<SONG SONG_NAME="Everytime You Turn Around"/>
<SONG SONG_NAME="Life After You"/>
<SONG SONG_NAME="What I Meant to Say"/>
<ALBUM PRICE="$15.99 USD"/>
<ALBUM ART=""/>
</ALBUM>
</BAND>
<BAND BAND_NAME="3Oh!3">
<ALBUM ALBUM_NAME="WANT">
<SONG SONG_NAME="Tapp"/>
<SONG SONG_NAME="Punk*****"/>
<SONG SONG_NAME="Don't Trust Me"/>
<SONG SONG_NAME="Chokechain"/>
<SONG SONG_NAME="I'm Not Your Boyfriend Baby"/>
<ALBUM PRICE="$9.99 USD"/>
</ALBUM>
<ALBUM ART=""/>
</BAND>
<BAND BAND_NAME="Metallica">
<ALBUM ALBUM_NAME="Garage Inc.">
<SONG SONG_NAME="Free speech for the Dumb"/>
<SONG SONG_NAME="It's Electric"/>
<SONG SONG_NAME="Sabbra Cadabra"/>
<SONG SONG_NAME="Turn the Page"/>
<SONG SONG_NAME="Die, Die My Darling"/>
<ALBUM PRICE="$19.99 USD"/>
<ALBUM ART=""/>
</ALBUM>
</BAND>
<BAND BAND_NAME="Ozzy Osbourne">
<ALBUM ALBUM_NAME="Essential Ozzy Osbourne">
<SONG SONG_NAME="Crazy Train"/>
<SONG SONG_NAME="Mr. Crowley"/>
<SONG SONG_NAME="I Don't Know"/>
<SONG SONG_NAME="Suicide Solution"/>
<SONG SONG_NAME="Goodbye to Romance"/>
<ALBUM PRICE="$59.99 USD"/>
<ALBUM ART=""/>
</ALBUM>
</BAND>
<BAND BAND_NAME="Alanis Morissette">
<ALBUM ALBUM_NAME="Jagged Little Pill">
<SONG SONG_NAME="All I Really Want"/>
<SONG SONG_NAME="You Ought Know"/>
<SONG SONG_NAME="Perfect"/>
<SONG SONG_NAME="Hand In My Pocket"/>
<SONG SONG_NAME="Right Through You"/>
<ALBUM PRICE="$29.99 USD"/>
<ALBUM ART=""/>
</ALBUM>
</BAND>
<BAND BAND_NAME="My Chemical Romance">
<ALBUM ALBUM_NAME="Three Cheers for Sweet Revenge">
<SONG SONG_NAME="Helena"/>
<SONG SONG_NAME="Give'em Hell Kid"/>
<SONG SONG_NAME="To the End"/>
<SONG SONG_NAME="You Know What They Do To Guys Like Us In Prison"/>
<SONG SONG_NAME="I'm Not Okay (I Promise)"/>
<ALBUM PRICE="$14.99 USD"/>
<ALBUM ART=""/>
</ALBUM>
</BAND>
<BAND BAND_NAME="Incubus">
<ALBUM ALBUM_NAME="Make Yourself">
<SONG SONG_NAME="Privilege"/>
<SONG SONG_NAME="Nowhere Fast"/>
<SONG SONG_NAME="Consequence"/>
<SONG SONG_NAME="The Warmth"/>
<SONG SONG_NAME="When It Comes"/>
<ALBUM PRICE="$9.99 USD"/>
<ALBUM ART=""/>
</ALBUM>
</BAND>
<BAND BAND_NAME="Lordi">
<ALBUM ALBUM_NAME="Arockalypse">
<SONG SONG_NAME="Hard Rock Hallelujah"/>
<SONG SONG_NAME="It Snows In Hell"/>
<SONG SONG_NAME="Deadite Girls Gone Wild"/>
<SONG SONG_NAME="Supermonstars"/>
<SONG SONG_NAME="Good To Be Bad"/>
<ALBUM PRICE="$19.99 USD"/>
<ALBUM ART=""/>
</ALBUM>
</BAND>
<BAND BAND_NAME="Pink">
<ALBUM ALBUM_NAME="Fun House">
<SONG SONG_NAME="So What"/>
<SONG SONG_NAME="Sober"/>
<SONG SONG_NAME="I Don't Believe You"/>
<SONG SONG_NAME="One Foot Wrong"/>
<SONG SONG_NAME="Please Don't Leave Me"/>
<ALBUM PRICE="$22.99 USD"/>
<ALBUM ART=""/>
</ALBUM>
</BAND>
<BAND BAND_NAME="The Smiths">
<ALBUM ALBUM_NAME="The Queen Is Dead">
<SONG SONG_NAME="Queen Is Dead (Take Me Back to Dear Old Blighty) [Medley]"/>
<SONG SONG_NAME="Frankly, Mr. Shankly"/>
<SONG SONG_NAME="I Know It's Over"/>
<SONG SONG_NAME="Never Had No One Ever"/>
<SONG SONG_NAME="Cemetry Gates"/>
<ALBUM PRICE="$49.99 USD"/>
<ALBUM ART=""/>
</ALBUM>
</BAND>
<BAND BAND_NAME="Simon & Garfunkel">
<ALBUM ALBUM_NAME="The Best of Simon & Garfunkel">
<SONG SONG_NAME="The Sound of Silence"/>
<SONG SONG_NAME="Homeward Bound"/>
<SONG SONG_NAME="I Am a Rock"/>
<SONG SONG_NAME="The Dangling Conversation"/>
<SONG SONG_NAME="Scarborough Fair"/>
<ALBUM PRICE="$19.99 USD"/>
<ALBUM ART=""/>
</ALBUM>
</BAND>
<BAND BAND_NAME="Veil of Maya">
<ALBUM ALBUM_NAME="The Common Man's Collapse">
<SONG SONG_NAME="Wounds"/>
<SONG SONG_NAME="Crawl Back"/>
<SONG SONG_NAME="Mark The Line"/>
<SONG SONG_NAME="It's Not Safe To Swim Today"/>
<SONG SONG_NAME="Entry Level Exit Wounds"/>
<ALBUM PRICE="$19.99 USD"/>
<ALBUM ART=""/>
</ALBUM>
</BAND>
<BAND BAND_NAME="Lil Wayne">
<ALBUM ALBUM_NAME="Tha Carter">
<SONG SONG_NAME="Walk In"/>
<SONG SONG_NAME="Go DJ"/>
<SONG SONG_NAME="This Is The Carter"/>
<SONG SONG_NAME="BM J.R."/>
<SONG SONG_NAME="I Miss My Dawg"/>
<ALBUM PRICE="Free"/>
<ALBUM ART=""/>
</ALBUM>
</BAND>
<BAND BAND_NAME="The Beatles">
<ALBUM ALBUM_NAME="Revolver">
<SONG SONG_NAME="Taxman Eleanor"/>
<SONG SONG_NAME="Rigby"/>
<SONG SONG_NAME="I'm Only Sleeping"/>
<SONG SONG_NAME="Love You To"/>
<SONG SONG_NAME="Here, There and Everywhere"/>
<ALBUM PRICE="$19.99 USD"/>
<ALBUM ART=""/>
</ALBUM>
</BAND>
</FAVORITEMUSIC>
Code:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="FAVORITEMUSIC">
<HTML>
<HEAD>
<TITLE>
CSIS-115B's Favorite Music
</TITLE>
</HEAD>
<BODY>
<xsl:for-each select="BAND">
<H1>
<xsl:value-of select="@BAND_NAME"/>
</H1>
<H3>
<xsl:value-of select="ALBUM/@ALBUM_NAME"/>
</H3>
<H5>
<xsl:value-of select="ALBUM/SONG/@SONG_NAME"/>
</H5>
</xsl:for-each>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
Last edited by IaN- : 09-25-09 at 09:34 PM |
|||||||||||||
|
|
|
|
|
#2 (permalink) |
|
Networking Nut
![]() |
Rewritten xml (with 3 bands) and xsl file.
page.xml Code:
<?xml version ="1.0"?>
<?xml-stylesheet type="text/xsl" href="music.xsl"?>
<favoritemusic title="CSIS-115B's Favorite Music">
<band band_name="Motley Crue" price="$19.99 USD" art="">
<album album_name="Greatest Hits Package">
<song>Live Wire</song>
<song>Public Enemy #1</song>
<song>Take Me To The Top</song>
<song>Merry-Go-Round</song>
<song>Piece Of Your Action</song>
</album>
</band>
<band band_name="Daughtry">
<album album_name="Leave This Town" price="$15.99 USD" art="">
<song>You Don't Belong</song>
<song>No Surprise</song>
<song>Everytime You Turn Around</song>
<song>Life After You</song>
<song>What I Meant to Say</song>
</album>
</band>
<band band_name="3Oh!3" price="$9.99 USD" art="">
<album album_name="WANT">
<song>Tapp</song>
<song>Punk*****</song>
<song>Don't Trust Me</song>
<song>Chokechain</song>
<song>I'm Not Your Boyfriend Baby</song>
</album>
</band>
</favoritemusic>
Code:
<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="favoritemusic"> <html> <head> <title> <xsl:value-of select="//@title" /> </title> </head> <body> <xsl:for-each select="band"> <h1><xsl:value-of select="@band_name" /></h1> <h3><xsl:value-of select="album/@album_name" /></h3> <ul> <xsl:for-each select="album/song"> <li><xsl:value-of select="." /></li> </xsl:for-each> </ul> </xsl:for-each> </body> </html> </xsl:template> </xsl:stylesheet> ![]() Here is a good XSL tutorial: http://www.w3schools.com/xsl/ Good luck! Last edited by Lyoko : 09-25-09 at 10:27 PM |
|
|
|
|
|
#3 (permalink) | |||||||||||||
|
New to Overclock.net
|
Thank you very much.
__________________
|
|||||||||||||
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|