Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 13th, 2012, 08:25 AM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Merging multiple xml files into a single xml file

Hi all

I have 4 xml files I want to merge in a single xml file called all.xml

1 File
<?xml version="1.0" ?>
<warnerupcomingreleases>
<release cover="rhcp_byTheWay.jpg" by="Red Hot Chili Peppers" called="By the Way" from="Warner Bros. Records" in="2005" oftype="Rock" instyle="Alternative Rock, Pop Rock">
<tracks A1="By the Way, 3.37" A2="Universally Speaking, 4.19" A3="This is the Place, 4.17" A4="Dosed, 5.12" />
<tracks B1="Don't Forget Me, 4.37" B2="The Zephyr Song, 3.52" B3="Can't Stop, 4.29" B4="I Could Die For You, 3.13" />
<tracks C1="Midnight, 4.55" C2="Throw Away Your Television, 3.44" C3="Cabron, 3.38" C4="Tear, 5.17" />
<tracks D1="On Mercury, 3.28" D2="Minor Thing, 3.37" D3="Warm Tape, 4.16" D4="Venice Queen, 6.07" />
</release>
<release cover="aha_hhal.jpg" by="a-ha" called="Hunting High and Low" from="Warner Bros. Records" in="1985" oftype="Electronic" instyle="Synth-pop">
<tracks A1="Take on Me, 3.46" A2="Train of Thought, 4.11" A3="Hunting High and Low, 3.43" A4="The Blue Sky, 2.22" A5="Living a Boy's Adventure Tale, 5.00" />
<tracks B1="The Sun Always Shines on T.V., 5.06" B2="And You Tell Me, 1.51" B3="Love is Reason, 3.04" B4="Dream Myself Alive, 3.06" B5="Here I Stand and Face the Rain, 4.30" />
</release>
</warnerupcomingreleases>

2nd File
<?xml version="1.0" ?>
<descriptions>
<album>
<artist>Jean Michel Jarre</artist>
<title>Equinoxe</title>
<description>
<p>
<![CDATA[Equinoxe (English: "equinox") was the second major-label album release by French musician Jean Michel Jarre, released on Disques Dreyfus (with license to Polydor) in late 1978.]]>
</p>
<p>
<![CDATA[The album reflects a day in the life of a human being, from morning to night. Parts 1 to 4 (i.e. side A) and tracks 5 to 8 (side B) segue smoothly from one to the next.]]>
</p>
<p>
<![CDATA[Jarre had developed his sound, employing more dynamic and rhythmic elements, particularly a greater use of sequencing on basslines. Much of this was achieved using custom equipment developed by his collaborator Michel Geiss.]]>
</p>
<p>
<![CDATA[The release was followed by a concert on the Place de la Concorde, Paris on July 14, 1979. The concert attracted 1 million people, becoming Jarre's first entry in the Guinness Book of Records for the largest crowd for an outdoor concert.]]>
</p>
<p>
<![CDATA[Two singles were released from the album, "Equinoxe Part 5" first, and then "Equinoxe Part 4". Part of "Equinoxe Part 8" has been played live with different arrangements, including a version for an acoustic street organ, under the title of "Band in the Rain".]]>
</p>
<p>
<![CDATA[The album reached #11 in the UK charts and #126 in the US charts.]]>
</p>
<p>
<![CDATA[During the 1980s, Equinoxe Part 4 was used in the opening credits of the TVNZ documentary series Our World.]]>
</p>
</description>
<promotional>
<pic>jmj1.jpg</pic>
<pic>jmj2.jpg</pic>
<pic>jmj3.jpg</pic>
</promotional>
</album>
<album>
<artist>Coldplay</artist>
<title>Viva la Vida or Death and All His Friends</title>
<description>
<p>
<![CDATA[Viva la Vida or Death and All His Friends, often referred to as simply Viva la Vida, is the fourth studio album by British rock band Coldplay, released on 11 June 2008 on Parlophone. The album was named after a Spanish phrase that translates in English as "long live life". Lyrically, the album contains references to love, life, death, and war.]]>
</p>
<p>
<![CDATA[Recording sessions for the album took place during June 2007 to April 2008 and featured production by Jon Hopkins, Rik Simpson, Markus Dravs and Brian Eno. The album was the first to be produced by the latter. The band forced themselves to explore experimental styles, as Eno required every song on the album to sound different, and expanded their musical interests while recording Viva la Vida. The band wanted to make the album shorter than 42 minutes. As a result, the album is longer than the length they intended. Development of the album delayed the release date several times.]]>
</p>
<p>
<![CDATA[Viva la Vida was both a critical and commercial success. Five singles have been released in promotion of the album; "Violet Hill" and "Viva la Vida" in May 2008, "Lovers in Japan" and "Lost!" in November 2008, and "Strawberry Swing" in September 2009. "Viva la Vida" became the band's first song to reach number one in both the United States and the United Kingdom. It won Best Rock Album at the 2009 Grammy Awards and was the best selling album of 2008. It was also nominated for Album of the Year. To date, the album has sold more than 10 million copies. Viva la Vida was re-released on 25 November 2008 in a deluxe edition containing the original album and the Prospekt's March EP.]]>
</p>
</description>
<promotional>
<pic>cp1.jpg</pic>
<pic>cp2.jpg</pic>
<pic>cp3.jpg</pic>
</promotional>
</album>
<album>
<artist>Mike Oldfield</artist>
<title>The Songs of Distant Earth</title>
<description>
<p>
<![CDATA[The Songs of Distant Earth is the 16th album by Mike Oldfield, released in 1994 by Warner Music. It is based on Arthur C. Clarke's science fiction novel The Songs of Distant Earth.]]>
</p>
<p>
<![CDATA[The album was released as a CD and, shortly afterwards, as an Enhanced CD of which two versions were made. Both versions' initial pressings featured an image of a Manta flying in front of a planet on the front cover. The cover image was changed to one of a suited man holding a glowing orb with manta rays flying overhead. The second pressing of the enhanced CD contains slightly more multimedia content, including the full version of the "Let There Be Light" video. The CD audio content is the same on all versions of the album. It was also released as a vinyl LP, which has become a rare item.]]>
</p>
<p>
<![CDATA[The enhanced CD content, for Apple Macintosh Power PC computers only, was rendered on Silicon Graphics computers and used Apple's QuickTime II technology. The re-release back cover lists the "CD ROM Track" as track 000 (where all tracks have a three-digit number), and a length of 0:00. Produced in 1994 it was an early example of Enhanced CD content.]]>
</p>
</description>
<promotional>
<pic>mo1.jpg</pic>
<pic>mo2.jpg</pic>
<pic>mo3.jpg</pic>
</promotional>
</album>
<album>
<artist>Moby</artist>
<title>Wait for Me</title>
<description>
<p>
<![CDATA[Wait for Me is the ninth studio album by American electronica musician Moby, released on June 29, 2009. Moby announced the title, track listing, and release date of the album on his website on April 14, 2009.]]>
</p>
<p>
<![CDATA[The first single from the album was "Shot in the Back of the Head". The song's accompanying music video was directed by David Lynch. The videos to "Pale Horses" and "Mistake" feature the alien shown on the cover and a dog. The alien is a new design of "Little Idiot" who appeared in earlier videos and is also the name of Moby's own label, on which the album was released.]]>
</p>
<p>
<![CDATA[The album was re-released as a Deluxe Edition on November 23, 2009 featuring the complete Wait for Me original album, two new songs (including the brand new single "One Time We Lived"), an extra CD of ambient versions of almost all the songs, and a DVD featuring many recent live performances, an intimate EPK of the album, a section of questions and answers, and five music videos made for the album.]]>
</p>
</description>
<promotional>
<pic>moby1.jpg</pic>
<pic>moby2.jpg</pic>
<pic>moby3.jpg</pic>
</promotional>
</album>
</descriptions>


3rd File

<?xml version="1.0" ?>
<Teleprompt>
<FullLabel>Teleprompt Records</FullLabel>
<VinylRecord CoverPic="mm_armistice.jpg">
<Band>Mutemath</Band>
<RecordTitle>Armistice</RecordTitle>
<Year>2009</Year>
<Genre>Rock</Genre>
<Style>Alternative Rock</Style>
<Tracks>
<Song Side="A" Track="1">
The Nerve
<Length>2.58</Length>
</Song>
<Song Side="A" Track="2">
Backfire
<Length>3.22</Length>
</Song>
<Song Side="A" Track="3">
Clipping
<Length>4.05</Length>
</Song>
<Song Side="A" Track="4">
Spotlight
<Length>3.21</Length>
</Song>
<Song Side="A" Track="5">
No Response
<Length>4.01</Length>
</Song>
<Song Side="A" Track="6">
Pins and Needles
<Length>4.05</Length>
</Song>
<Song Side="B" Track="1">
Goodbye
<Length>4.09</Length>
</Song>
<Song Side="B" Track="2">
Odds
<Length>3.01</Length>
</Song>
<Song Side="B" Track="3">
Electrify
<Length>3.49</Length>
</Song>
<Song Side="B" Track="4">
Armistice
<Length>3.54</Length>
</Song>
<Song Side="B" Track="5">
Lost Year
<Length>3.13</Length>
</Song>
<Song Side="B" Track="6">
Burden
<Length>9.06</Length>
</Song>
</Tracks>
</VinylRecord>
</Teleprompt>

4th File

<?xml version="1.0" ?>
<forSale>
<album cover="cp_vivaLaVida.jpg">
<artist>Coldplay</artist>
<title>Viva la Vida or Death and All His Friends</title>
<label>Parlophone</label>
<released>2008</released>
<genre>Pop, Rock</genre>
<style>Acoustic, Pop Rock, Indie Rock</style>
<tracklist>
<sideA>
<track no="1" runtime="2.29">Life in Technicolor</track>
<track no="2" runtime="3.21">Cemeteries of London</track>
<track no="3" runtime="3.55">Lost!</track>
<track no="4" runtime="3.57">42</track>
<track no="5" runtime="6.51">Lovers in Japan / Reign of Love</track>
</sideA>
<sideB>
<track no="1" runtime="7.05">Yes / Chinese Sleep Chant</track>
<track no="2" runtime="4.04">Viva la Vida</track>
<track no="3" runtime="3.50">Violet Hill</track>
<track no="4" runtime="4.09">Strawberry Swing</track>
<track no="5" runtime="6.19">Death and All His Friends / The Escapist</track>
</sideB>
</tracklist>
</album>
<album cover="moby_waitForMe.jpg">
<artist>Moby</artist>
<title>Wait for Me</title>
<label>Little Idiot</label>
<released>2009</released>
<genre>Electronic</genre>
<style>Experimental, Ambient</style>
<tracklist>
<sideA>
<track no="1" runtime="1.56">Division</track>
<track no="2" runtime="3.37">Pale Horses</track>
<track no="3" runtime="3.15">Shot in the Back of the Head</track>
<track no="4" runtime="4.18">Study War</track>
</sideA>
<sideB>
<track no="1" runtime="4.01">Walk with Me</track>
<track no="2" runtime="0.55">Stock Radio</track>
<track no="3" runtime="3.47">Mistake</track>
<track no="4" runtime="2.48">Scream Pilots</track>
</sideB>
<sideC>
<track no="1" runtime="4.01">jltf-1</track>
<track no="2" runtime="0.55">jltf</track>
<track no="3" runtime="3.47">A Seated Night</track>
<track no="4" runtime="2.48">Wait for Me</track>
<track no="5" runtime="3.31">Hope is Gone</track>
</sideC>
<sideD>
<track no="1" runtime="2.38">Ghost Return</track>
<track no="2" runtime="4.00">Slow Light</track>
<track no="3" runtime="3.28">Isolate</track>
</sideD>
</tracklist>
</album>
<album cover="mo_tsode.jpg">
<artist>Mike Oldfield</artist>
<title>The Songs of Distant Earth</title>
<label>WEA</label>
<released>1994</released>
<genre>Electronic, Rock</genre>
<style>New Age, Downtempo, Experimental, Ambient</style>
<tracklist>
<sideA>
<track no="1" runtime="1.24">In the Beginning</track>
<track no="2" runtime="4.52">Let There Be Light</track>
<track no="3" runtime="3.29">Supernova</track>
<track no="4" runtime="4.41">Magellan</track>
<track no="5" runtime="1.16">First Landing</track>
<track no="6" runtime="3.27">Oceania</track>
<track no="7" runtime="4.19">Only Time Will Tell</track>
<track no="8" runtime="2.10">Prayer for the Earth</track>
<track no="9" runtime="2.44">Lament for Atlantis</track>
</sideA>
<sideB>
<track no="1" runtime="1.49">The Chamber</track>
<track no="2" runtime="3.32">Hibernaculum</track>
<track no="3" runtime="3.23">Tubular World</track>
<track no="4" runtime="2.59">The Shining Ones</track>
<track no="5" runtime="5.42">Crystal Clear</track>
<track no="6" runtime="2.39">The Sunken Forest</track>
<track no="7" runtime="5.48">Ascension</track>
<track no="8" runtime="1.33">A New Beginning</track>
</sideB>
</tracklist>
</album>
<album cover="jmj_equinoxe.jpg">
<artist>Jean Michel Jarre</artist>
<title>Equinoxe</title>
<label>Polydor</label>
<released>1978</released>
<genre>Electronic</genre>
<style>Synth-pop, Experimental, Ambient</style>
<tracklist>
<sideA>
<track no="1" runtime="2.23">Equinoxe Part 1</track>
<track no="2" runtime="5.13">Equinoxe Part 2</track>
<track no="3" runtime="5.04">Equinoxe Part 3</track>
<track no="4" runtime="6.45">Equinoxe Part 4</track>
</sideA>
<sideB>
<track no="1" runtime="3.59">Equinoxe Part 5</track>
<track no="2" runtime="3.09">Equinoxe Part 6</track>
<track no="3" runtime="7.18">Equinoxe Part 7</track>
<track no="4" runtime="5.06">Equinoxe Part 8</track>
</sideB>
</tracklist>
</album>
</forSale>

I know I have to create a style sheet to combine all of them

Please help!
Thanks
Reply With Quote
  #2 (permalink)  
Old April 13th, 2012, 08:55 AM
Friend of Wrox
Points: 6,438, Level: 34
Points: 6,438, Level: 34 Points: 6,438, Level: 34 Points: 6,438, Level: 34
Activity: 16%
Activity: 16% Activity: 16% Activity: 16%
 
Join Date: Nov 2007
Location: Germany
Posts: 1,196
Thanks: 0
Thanked 236 Times in 235 Posts
Default

Edit your post please to provide minimal and formatted http://p2p.wrox.com/misc.php?do=bbcode#code samples to demonstrate the input data and then the corresponding result sample you want to create with XSLT. Then we can help with the XSLT. I am afraid dumping longish unformatted samples makes it hard for us to understand the problem.
In general to combine several documents in one transformation, you will need to read in the secondary documents with the XSLT http://www.w3.org/TR/xslt#document function.
To cross-reference nodes keys can help, let us know whether you target XSLT 1.0 or 2.0.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
Reply With Quote
  #3 (permalink)  
Old April 13th, 2012, 04:51 PM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I target XSLT 1.0

For the first file
Code:
<?xml version="1.0" ?>
<warnerupcomingreleases>
	<release cover="rhcp_byTheWay.jpg" by="Red Hot Chili Peppers" called="By the Way" from="Warner Bros. Records" in="2005" oftype="Rock" instyle="Alternative Rock, Pop Rock">
		<tracks A1="By the Way, 3.37" A2="Universally Speaking, 4.19" A3="This is the Place, 4.17" A4="Dosed, 5.12" />
		<tracks B1="Don't Forget Me, 4.37" B2="The Zephyr Song, 3.52" B3="Can't Stop, 4.29" B4="I Could Die For You, 3.13" />
		<tracks C1="Midnight, 4.55" C2="Throw Away Your Television, 3.44" C3="Cabron, 3.38" C4="Tear, 5.17" />
		<tracks D1="On Mercury, 3.28" D2="Minor Thing, 3.37" D3="Warm Tape, 4.16" D4="Venice Queen, 6.07" />
	</release>
	<release cover="aha_hhal.jpg" by="a-ha" called="Hunting High and Low" from="Warner Bros. Records" in="1985" oftype="Electronic" instyle="Synth-pop">
		<tracks A1="Take on Me, 3.46" A2="Train of Thought, 4.11" A3="Hunting High and Low, 3.43" A4="The Blue Sky, 2.22" A5="Living a Boy's Adventure Tale, 5.00" />
		<tracks B1="The Sun Always Shines on T.V., 5.06" B2="And You Tell Me, 1.51" B3="Love is Reason, 3.04" B4="Dream Myself Alive, 3.06" B5="Here I Stand and Face the Rain, 4.30" />
	</release>
</warnerupcomingreleases>
For the second file
Code:
<?xml version="1.0" ?>
<Teleprompt>
	<FullLabel>Teleprompt Records</FullLabel>
	<VinylRecord CoverPic="mm_armistice.jpg">
		<Band>Mutemath</Band>
		<RecordTitle>Armistice</RecordTitle>
		<Year>2009</Year>
		<Genre>Rock</Genre>
		<Style>Alternative Rock</Style>
		<Tracks>
			<Song Side="A" Track="1">
				The Nerve
				<Length>2.58</Length>
			</Song>
			<Song Side="A" Track="2">
				Backfire
				<Length>3.22</Length>
			</Song>	
			<Song Side="A" Track="3">
				Clipping
				<Length>4.05</Length>
			</Song>
			<Song Side="A" Track="4">
				Spotlight
				<Length>3.21</Length>
			</Song>
			<Song Side="A" Track="5">
				No Response
				<Length>4.01</Length>
			</Song>
			<Song Side="A" Track="6">
				Pins and Needles
				<Length>4.05</Length>
			</Song>
			<Song Side="B" Track="1">
				Goodbye
				<Length>4.09</Length>
			</Song>
			<Song Side="B" Track="2">
				Odds
				<Length>3.01</Length>
			</Song>
			<Song Side="B" Track="3">
				Electrify
				<Length>3.49</Length>
			</Song>
			<Song Side="B" Track="4">
				Armistice
				<Length>3.54</Length>
			</Song>
			<Song Side="B" Track="5">
				Lost Year
				<Length>3.13</Length>
			</Song>
			<Song Side="B" Track="6">
				Burden
				<Length>9.06</Length>
			</Song>
		</Tracks>
	</VinylRecord>
</Teleprompt>
For the Third File
Code:
<?xml version="1.0" ?>
<descriptions>
	<album>
		<artist>Jean Michel Jarre</artist>
		<title>Equinoxe</title>
		<description>
			<p>
				<![CDATA[Equinoxe (English: "equinox") was the second major-label album release by French musician Jean Michel Jarre, released on Disques Dreyfus (with license to Polydor) in late 1978.]]>
			</p>
			<p>
				<![CDATA[The album reflects a day in the life of a human being, from morning to night. Parts 1 to 4 (i.e. side A) and tracks 5 to 8 (side B) segue smoothly from one to the next.]]>
			</p>
			<p>
				<![CDATA[Jarre had developed his sound, employing more dynamic and rhythmic elements, particularly a greater use of sequencing on basslines. Much of this was achieved using custom equipment developed by his collaborator Michel Geiss.]]>
			</p>
			<p>
				<![CDATA[The release was followed by a concert on the Place de la Concorde, Paris on July 14, 1979. The concert attracted 1 million people, becoming Jarre's first entry in the Guinness Book of Records for the largest crowd for an outdoor concert.]]>			
			</p>
			<p>
				<![CDATA[Two singles were released from the album, "Equinoxe Part 5" first, and then "Equinoxe Part 4". Part of "Equinoxe Part 8" has been played live with different arrangements, including a version for an acoustic street organ, under the title of "Band in the Rain".]]>			
			</p>
			<p>
				<![CDATA[The album reached #11 in the UK charts and #126 in the US charts.]]>			
			</p>
			<p>
				<![CDATA[During the 1980s, Equinoxe Part 4 was used in the opening credits of the TVNZ documentary series Our World.]]>			
			</p>
		</description>
		<promotional>
			<pic>jmj1.jpg</pic>
			<pic>jmj2.jpg</pic>
			<pic>jmj3.jpg</pic>
		</promotional>
	</album>
	<album>
		<artist>Coldplay</artist>
		<title>Viva la Vida or Death and All His Friends</title>
		<description>
			<p>
				<![CDATA[Viva la Vida or Death and All His Friends, often referred to as simply Viva la Vida, is the fourth studio album by British rock band Coldplay, released on 11 June 2008 on Parlophone. The album was named after a Spanish phrase that translates in English as "long live life". Lyrically, the album contains references to love, life, death, and war.]]>
			</p>
			<p>
				<![CDATA[Recording sessions for the album took place during June 2007 to April 2008 and featured production by Jon Hopkins, Rik Simpson, Markus Dravs and Brian Eno. The album was the first to be produced by the latter. The band forced themselves to explore experimental styles, as Eno required every song on the album to sound different, and expanded their musical interests while recording Viva la Vida. The band wanted to make the album shorter than 42 minutes. As a result, the album is longer than the length they intended. Development of the album delayed the release date several times.]]>
			</p>
			<p>
				<![CDATA[Viva la Vida was both a critical and commercial success. Five singles have been released in promotion of the album; "Violet Hill" and "Viva la Vida" in May 2008, "Lovers in Japan" and "Lost!" in November 2008, and "Strawberry Swing" in September 2009. "Viva la Vida" became the band's first song to reach number one in both the United States and the United Kingdom. It won Best Rock Album at the 2009 Grammy Awards and was the best selling album of 2008. It was also nominated for Album of the Year. To date, the album has sold more than 10 million copies. Viva la Vida was re-released on 25 November 2008 in a deluxe edition containing the original album and the Prospekt's March EP.]]>
			</p>
		</description>
		<promotional>
			<pic>cp1.jpg</pic>
			<pic>cp2.jpg</pic>
			<pic>cp3.jpg</pic>
		</promotional>
	</album>
	<album>
		<artist>Mike Oldfield</artist>
		<title>The Songs of Distant Earth</title>
		<description>
			<p>
				<![CDATA[The Songs of Distant Earth is the 16th album by Mike Oldfield, released in 1994 by Warner Music. It is based on Arthur C. Clarke's science fiction novel The Songs of Distant Earth.]]>
			</p>
			<p>
				<![CDATA[The album was released as a CD and, shortly afterwards, as an Enhanced CD of which two versions were made. Both versions' initial pressings featured an image of a Manta flying in front of a planet on the front cover. The cover image was changed to one of a suited man holding a glowing orb with manta rays flying overhead. The second pressing of the enhanced CD contains slightly more multimedia content, including the full version of the "Let There Be Light" video. The CD audio content is the same on all versions of the album. It was also released as a vinyl LP, which has become a rare item.]]>
			</p>
			<p>
				<![CDATA[The enhanced CD content, for Apple Macintosh Power PC computers only, was rendered on Silicon Graphics computers and used Apple's QuickTime II technology. The re-release back cover lists the "CD ROM Track" as track 000 (where all tracks have a three-digit number), and a length of 0:00. Produced in 1994 it was an early example of Enhanced CD content.]]>
			</p>
		</description>
		<promotional>
			<pic>mo1.jpg</pic>
			<pic>mo2.jpg</pic>
			<pic>mo3.jpg</pic>
		</promotional>
	</album>
	<album>
		<artist>Moby</artist>
		<title>Wait for Me</title>
		<description>
			<p>
				<![CDATA[Wait for Me is the ninth studio album by American electronica musician Moby, released on June 29, 2009. Moby announced the title, track listing, and release date of the album on his website on April 14, 2009.]]>
			</p>
			<p>
				<![CDATA[The first single from the album was "Shot in the Back of the Head". The song's accompanying music video was directed by David Lynch. The videos to "Pale Horses" and "Mistake" feature the alien shown on the cover and a dog. The alien is a new design of "Little Idiot" who appeared in earlier videos and is also the name of Moby's own label, on which the album was released.]]>
			</p>
			<p>
				<![CDATA[The album was re-released as a Deluxe Edition on November 23, 2009 featuring the complete Wait for Me original album, two new songs (including the brand new single "One Time We Lived"), an extra CD of ambient versions of almost all the songs, and a DVD featuring many recent live performances, an intimate EPK of the album, a section of questions and answers, and five music videos made for the album.]]>
			</p>
		</description>
		<promotional>
			<pic>moby1.jpg</pic>
			<pic>moby2.jpg</pic>
			<pic>moby3.jpg</pic>
		</promotional>
	</album>
</descriptions>
For the fourth file

Code:
<?xml version="1.0" ?>
<forSale>
	<album cover="cp_vivaLaVida.jpg">
		<artist>Coldplay</artist>
		<title>Viva la Vida or Death and All His Friends</title>
		<label>Parlophone</label>
		<released>2008</released>
		<genre>Pop, Rock</genre>
		<style>Acoustic, Pop Rock, Indie Rock</style>
		<tracklist>
			<sideA>
				<track no="1" runtime="2.29">Life in Technicolor</track>
				<track no="2" runtime="3.21">Cemeteries of London</track>
				<track no="3" runtime="3.55">Lost!</track>
				<track no="4" runtime="3.57">42</track>
				<track no="5" runtime="6.51">Lovers in Japan / Reign of Love</track>
			</sideA>
			<sideB>
				<track no="1" runtime="7.05">Yes / Chinese Sleep Chant</track>
				<track no="2" runtime="4.04">Viva la Vida</track>
				<track no="3" runtime="3.50">Violet Hill</track>
				<track no="4" runtime="4.09">Strawberry Swing</track>
				<track no="5" runtime="6.19">Death and All His Friends / The Escapist</track>
			</sideB>
		</tracklist>
	</album>
	<album cover="moby_waitForMe.jpg">
		<artist>Moby</artist>
		<title>Wait for Me</title>
		<label>Little Idiot</label>
		<released>2009</released>
		<genre>Electronic</genre>
		<style>Experimental, Ambient</style>
		<tracklist>
			<sideA>
				<track no="1" runtime="1.56">Division</track>
				<track no="2" runtime="3.37">Pale Horses</track>
				<track no="3" runtime="3.15">Shot in the Back of the Head</track>
				<track no="4" runtime="4.18">Study War</track>
			</sideA>
			<sideB>
				<track no="1" runtime="4.01">Walk with Me</track>
				<track no="2" runtime="0.55">Stock Radio</track>
				<track no="3" runtime="3.47">Mistake</track>
				<track no="4" runtime="2.48">Scream Pilots</track>
			</sideB>
			<sideC>
				<track no="1" runtime="4.01">jltf-1</track>
				<track no="2" runtime="0.55">jltf</track>
				<track no="3" runtime="3.47">A Seated Night</track>
				<track no="4" runtime="2.48">Wait for Me</track>
				<track no="5" runtime="3.31">Hope is Gone</track>
			</sideC>
			<sideD>
				<track no="1" runtime="2.38">Ghost Return</track>
				<track no="2" runtime="4.00">Slow Light</track>
				<track no="3" runtime="3.28">Isolate</track>
			</sideD>
		</tracklist>
	</album>
	<album cover="mo_tsode.jpg">
		<artist>Mike Oldfield</artist>
		<title>The Songs of Distant Earth</title>
		<label>WEA</label>
		<released>1994</released>
		<genre>Electronic, Rock</genre>
		<style>New Age, Downtempo, Experimental, Ambient</style>
		<tracklist>
			<sideA>
				<track no="1" runtime="1.24">In the Beginning</track>
				<track no="2" runtime="4.52">Let There Be Light</track>
				<track no="3" runtime="3.29">Supernova</track>
				<track no="4" runtime="4.41">Magellan</track>
				<track no="5" runtime="1.16">First Landing</track>
				<track no="6" runtime="3.27">Oceania</track>
				<track no="7" runtime="4.19">Only Time Will Tell</track>
				<track no="8" runtime="2.10">Prayer for the Earth</track>
				<track no="9" runtime="2.44">Lament for Atlantis</track>
			</sideA>
			<sideB>
				<track no="1" runtime="1.49">The Chamber</track>
				<track no="2" runtime="3.32">Hibernaculum</track>
				<track no="3" runtime="3.23">Tubular World</track>
				<track no="4" runtime="2.59">The Shining Ones</track>
				<track no="5" runtime="5.42">Crystal Clear</track>
				<track no="6" runtime="2.39">The Sunken Forest</track>
				<track no="7" runtime="5.48">Ascension</track>
				<track no="8" runtime="1.33">A New Beginning</track>
			</sideB>
		</tracklist>
	</album>
	<album cover="jmj_equinoxe.jpg">
		<artist>Jean Michel Jarre</artist>
		<title>Equinoxe</title>
		<label>Polydor</label>
		<released>1978</released>
		<genre>Electronic</genre>
		<style>Synth-pop, Experimental, Ambient</style>
		<tracklist>
			<sideA>
				<track no="1" runtime="2.23">Equinoxe Part 1</track>
				<track no="2" runtime="5.13">Equinoxe Part 2</track>
				<track no="3" runtime="5.04">Equinoxe Part 3</track>
				<track no="4" runtime="6.45">Equinoxe Part 4</track>
			</sideA>
			<sideB>
				<track no="1" runtime="3.59">Equinoxe Part 5</track>
				<track no="2" runtime="3.09">Equinoxe Part 6</track>
				<track no="3" runtime="7.18">Equinoxe Part 7</track>
				<track no="4" runtime="5.06">Equinoxe Part 8</track>
			</sideB>
		</tracklist>
	</album>
</forSale>
And the resulting output should look file this:
Code:
<?xml version="1.0" ?>
<!-- This document shows what the structure of your final master XML document must look like. -->
<!-- HOWEVER, it does not include the additional step that you need to perform: adding namespaces. -->
<!-- See the specification for more details. -->
<vm>
	<forSale>
		<album cover="cp_vivaLaVida.jpg">
			<artist>Coldplay</artist>
			<title>Viva la Vida or Death and All His Friends</title>
			<label>Parlophone</label>
			<released>2008</released>
			<genre>Pop, Rock</genre>
			<style>Acoustic, Pop Rock, Indie Rock</style>
			<tracklist>
				<sideA>
					<track no="1" runtime="2.29">Life in Technicolor</track>
					<track no="2" runtime="3.21">Cemeteries of London</track>
					<track no="3" runtime="3.55">Lost!</track>
					<track no="4" runtime="3.57">42</track>
					<track no="5" runtime="6.51">Lovers in Japan / Reign of Love</track>
				</sideA>
				<sideB>
					<track no="1" runtime="7.05">Yes / Chinese Sleep Chant</track>
					<track no="2" runtime="4.04">Viva la Vida</track>
					<track no="3" runtime="3.50">Violet Hill</track>
					<track no="4" runtime="4.09">Strawberry Swing</track>
					<track no="5" runtime="6.19">Death and All His Friends / The Escapist</track>
				</sideB>
			</tracklist>
			<description>
				<p>
					<![CDATA[Viva la Vida or Death and All His Friends, often referred to as simply Viva la Vida, is the fourth studio album by British rock band Coldplay, released on 11 June 2008 on Parlophone. The album was named after a Spanish phrase that translates in English as "long live life". Lyrically, the album contains references to love, life, death, and war.]]>
				</p>
				<p>
					<![CDATA[Recording sessions for the album took place during June 2007 to April 2008 and featured production by Jon Hopkins, Rik Simpson, Markus Dravs and Brian Eno. The album was the first to be produced by the latter. The band forced themselves to explore experimental styles, as Eno required every song on the album to sound different, and expanded their musical interests while recording Viva la Vida. The band wanted to make the album shorter than 42 minutes. As a result, the album is longer than the length they intended. Development of the album delayed the release date several times.]]>
				</p>
				<p>
					<![CDATA[Viva la Vida was both a critical and commercial success. Five singles have been released in promotion of the album; "Violet Hill" and "Viva la Vida" in May 2008, "Lovers in Japan" and "Lost!" in November 2008, and "Strawberry Swing" in September 2009. "Viva la Vida" became the band's first song to reach number one in both the United States and the United Kingdom. It won Best Rock Album at the 2009 Grammy Awards and was the best selling album of 2008. It was also nominated for Album of the Year. To date, the album has sold more than 10 million copies. Viva la Vida was re-released on 25 November 2008 in a deluxe edition containing the original album and the Prospekt's March EP.]]>
				</p>
			</description>
			<promotional>
				<pic>cp1.jpg</pic>
				<pic>cp2.jpg</pic>
				<pic>cp3.jpg</pic>
			</promotional>
		</album>
		<!-- More albums -->
	</forSale>
	<upcoming>
		<album cover="mm_armistice.jpg">
			<artist>Mutemath</artist>
			<title>Armistice</title>
			<label>Teleprompt Records</label>
			<released>2009</released>
			<genre>Rock</genre>
			<style>Alternative Rock</style>
			<tracklist>
				<sideA>
					<track no="1" runtime="2.58">The Nerve</track>
					<track no="2" runtime="3.22">Backfire</track>
					<track no="3" runtime="4.05">Clipping</track>
					<track no="4" runtime="3.21">Spotlight</track>
					<track no="5" runtime="4.01">No Response</track>
					<track no="6" runtime="4.05">Pins and Needles</track>
				</sideA>
				<sideB>
					<track no="1" runtime="4.09">Goodbye</track>
					<track no="2" runtime="3.01">Odds</track>
					<track no="3" runtime="3.49">Electrify</track>
					<track no="4" runtime="3.54">Armistice</track>
					<track no="5" runtime="3.13">Lost Year</track>
					<track no="6" runtime="9.06">Burden</track>
				</sideB>
			</tracklist>
		</album>
		<!-- More albums -->
	</upcoming>
</vm>
Thanks!
Reply With Quote
  #4 (permalink)  
Old April 18th, 2012, 06:48 AM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, am still waiting for help guys
Reply With Quote
  #5 (permalink)  
Old April 18th, 2012, 10:13 AM
samjudson's Avatar
Friend of Wrox
Points: 8,448, Level: 39
Points: 8,448, Level: 39 Points: 8,448, Level: 39 Points: 8,448, Level: 39
Activity: 33%
Activity: 33% Activity: 33% Activity: 33%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,088
Thanks: 1
Thanked 181 Times in 180 Posts
Default

Well what have you tried so far?
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to process multiple input xml files with a single xslt ? Divya XSLT 8 April 24th, 2014 09:28 AM
Combine multiple xml files to create one xml file jonnyuk3 XSLT 6 March 29th, 2012 11:51 AM
problem in merging of XML Files rajatake XSLT 5 April 29th, 2006 12:57 PM
grouping multiple xml files in one file bcogney XSLT 3 April 21st, 2006 03:58 AM



All times are GMT -4. The time now is 04:10 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.