Thread: Xslt
View Single Post
  #4 (permalink)  
Old 01-17-2008, 10:17 AM
chrishirst's Avatar
chrishirst chrishirst is offline
WMG Sheriff
 
Join Date: Nov 2007
Posts: 170
iTrader: (0)
chrishirst is on a distinguished road
Default

XML is the "adjective" of programming languages. It's a "describing" language.

It is used to describe the data it holds. So to use for a record library as an example;
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<collection>
	<album>
		<artist>Muse</artist>
		<title>Black Holes and Revelations</title>
		<tracklist>
			<track>
				<name>Take a Bow</name>
				<time>4:39</time>
			</track>
			<track>
				<name>Starlight</name>
				<time>3:57</time>
			<track>
				<name>Supermassive Black Hole</name>
				<time>3:29</time>
			<track>
				<name>Map of the Problematique</name>
				<time>4:23</time>
			</track>
			<track>
				<name>Soldier’s Poem</name>
				<time>2:10</time>
			</track>
			<track>
				<name>Invincible</name>
				<time>4:54</time>
			</track>
			<track>
				<name>Assassin</name>
				<time>3:34</time>
			</track>
			<track>
				<name>Exo-Politics</name>
				<time>3:53</time>
			</track>
			<track>
				<name>City of Delusion</name>
				<time>4:48</time>
			</track>
			<track>
				<name>Hoodoo</name>
				<time>3:42</time>
			</track>
			<track>
				<name>Knights of Cydonia</name>
				<time>6:03</time>
			</track>
			<track>
				<name>Glorious" (bonus track)</name>
				<time>4:38</time>
			</track>
		</tracklist>
		<formats>
			<format>CD</format>
			<format>MiniDisc</format>
			<format>MP3</format>
		</formats>
	</album>

	<album>
	.
	.
	.
	</album>
</collection>
could be a node format for holding the data.

You could then write a XSL Style Sheet that told the browser/viewer exactly how you wanted the information to look.

So, instead of writing an application in a server side language to store the data in a database, extract it and display it, the whole process could be compressed into a couple of text files, which is totally self contained and, more importantly, doesn't need a web server to run on.


I don't use XML/XSLT for web apps very much, but I frequently use XML as a data storage medium.
__________________
And how can we win, when fools can be kings
Reply With Quote
Sponsored Links
Register and sign in to hide this ad block