Lunarpages Web Hosting
 
Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read Web Directory

Go Back   Webmaster Forum > Designing and Developing Websites > Programming

Programming Discussions and help on web programming and scripting, PHP, ASP, ColdFusion, Ajax, Perl, etc...

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 01-16-2008, 02:23 PM
alexd181 alexd181 is offline
WMG Resident Alien
 
Join Date: Jan 2008
Posts: 104
iTrader: (0)
alexd181 is on a distinguished road
Default Xslt

XSLT - does anyone here use it? I am learning about how to use it, but so far I'm not sure why you'd use it. What are the main applications?
Reply With Quote
Sponsored Links
Register and sign in to hide this ad block

  #2 (permalink)  
Old 01-17-2008, 12:39 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

Making XML look pretty
__________________
And how can we win, when fools can be kings
Reply With Quote
  #3 (permalink)  
Old 01-17-2008, 01:02 AM
alexd181 alexd181 is offline
WMG Resident Alien
 
Join Date: Jan 2008
Posts: 104
iTrader: (0)
alexd181 is on a distinguished road
Default

I know, but what is XML normally used for? Eg. I know it can be used for external sitemaps etc. but what would a webdesigner use it for typically? Do you use it?

Quote:
And how can we win, when fools can be kings
Don't waste your time or time will waste you.
Reply With Quote
  #4 (permalink)  
Old 01-17-2008, 09: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
  #5 (permalink)  
Old 01-17-2008, 10:15 AM
alexd181 alexd181 is offline
WMG Resident Alien
 
Join Date: Jan 2008
Posts: 104
iTrader: (0)
alexd181 is on a distinguished road
Default

That makes a lot of sense with the music example. However it sounds like XML cannot be updated dynamically, where as a database can. I don't see how you could add an entry later without editing the code which makes mysql seem favorable. Can XML be used with mysql or does that defeat the purpose?
Reply With Quote
  #6 (permalink)  
Old 01-17-2008, 12:37 PM
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 can be updated dynamically by any application that can handle XML obviously you need to know the document structure.
RSS feeds are simply an XML document with a defined and controlled node structure, they can be updated "on the fly" by code.

Yes, XML can be used with databases. SQL 2005 has direct support for output as XML rather than needing a third party app.

If you want to make a snapshot of data available (RSS feeds for example) to external consumers you can export the db data to a XML file.
__________________
And how can we win, when fools can be kings
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

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

All times are GMT. The time now is 07:26 PM.



Freelance Web Designers
Work At Home Forum
Ad Marketplace
Online Deals and Bargains
iPower Hosting Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0