![]() |
|
#1
|
||||
|
||||
[Tutorial] XSL Basics Pt. IXSL
So you what to learn XSL. Well set back and relax because I’m going to teach you how. First there are a few things that you may what to know and remember XSL is a W3C Standard But that doesn’t mean that everyone is ready for it. The first two parts of the language (XSLT And XPath ) became a W3C recommendation in Nov 99. The full XSL recommendation including XSL formatting became a W3C recommendation in Oct 01. So you may ask what all this means Well it means that some web browsers will not work or will have problems displaying all option available in XSL. So I would Recommend that if your able to use IE 6 or Netscape 6 do IE 5 or 5.5 will not work with all of this Articale. Ok lets learn a little about XSL shall we? XSL consists of three parts: XSLT (a language for transforming XML documents) Xpath (a language for defining parts of an XML document) XSL Formatting Objects (a vocabulary for formatting XML documents) If this is all confusing you think of it this way. XSL is a language that can transform XML into XHTML, A language that can filter and sort XML data, a language that can define parts of an XML document A language that can format XML data based on the data value. A language that can output XML data To different devices, like screen, paper or voice all of this from XSL. Ok so lets get are hands dirty. The root element that declares the document to be XSL style sheet is <xsl:stylesheet> and <xsl:transform>, you can use either. The correct way to declare an XSL style sheet according to the W3C XSL Recommendation is HTML Code:
HTML Code:
Note: The xmlns:xsl="http://www.w3.org/1999/XSL/Transform" identifies the official W3C XSL recommendation namespace. If you use the namespace, you must include the version="1.0". If your using IE 6 or Netscape 6 you should use one of the codes above. Lets take a look at how to transform an XML document (gamelist.xml) into XHTML: HTML Code:
First you create an XSL Style Sheet (gamelist.xsl) with a transformation template: HTML Code:
Finally, Return to your first XML document (gamelist.xml) and add an XSL Style Sheet reference to your XML document like so: HTML Code:
That’s it your done, You have just learned how to transform XML into XHTML using XSL. Well that’s it for my first article. Next time we will break down the example here and discuss XSL in greater detail including XSL template, value-of and for-each. [gid=http://www.desilva.biz/forum/viewtopic573.php]XSL Basics Pt. II[/gid] __________________
If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization. Last edited by pcxgamer : 17-Apr-2003 at 07:20.
|
|
#2
|
||||
|
||||
|
What is the href value here?
HTML Code:
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#3
|
||||
|
||||
|
A mistake sorry I'll edit that it should be:
HTML Code:
__________________
If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization. |
|
#4
|
||||
|
||||
|
Is there anywhere I can see where this is used? It looks quite interesting.
|
|
#5
|
||||
|
||||
|
__________________
If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization. |
|
#6
|
||||
|
||||
|
How come it doesn't show the price and year their?
|
|
#7
|
||||
|
||||
|
I'm checking on that right now. I didn't really set that up for display. But I'm check right now I'll have it fix shortly.
Sorry __________________
If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization. |
|
#8
|
||||
|
||||
|
No need to apologise, I wasn't meaning that I was just trying to work out what was going on and making sure it wasn't at my end
|
|
#9
|
||||
|
||||
|
Are you use IE 6 or netscape 6?
__________________
If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization. |
|
#10
|
||||
|
||||
|
IE6, I tried it in Mozilla but like you said, it didn't like it. I'm surprised since Mozilla is supposed to be quite forward in new things like that.
|
Recent GIDBlog
Meeting the populace by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Tutorial] XSL Basics Pt. III | pcxgamer | Web Design Forum | 1 | 24-Apr-2003 08:04 |
| [Tutorial] XSL Basics Pt. II | pcxgamer | Web Design Forum | 0 | 21-Apr-2003 07:11 |
| [Tutorial] MySQL Basics | nniehoff | MySQL / PHP Forum | 15 | 23-Mar-2003 19:42 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The