<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="common.xsl"?>
<tutorial>
	<html>
	<head>
	<title/>
	<body>
	<category name="XSL Tutorials">
	<group name="Introduction"><description><![CDATA[With HTML, the tags are predefined and the meaning of these tags is well understood, the browser is therefore understand the markup and display it without using of any styling mechanisms. Thus, stylesheets are the additional option to HTML that give more flexibility to the document designers.<p>What about XML? well, with XML the authors can create their own tag sets, obviously the markup is simply not standardized and of course the browser does not know how to render it. Therefore, style sheets (such as CSS, XSL) and other display mechanisms are essential part of rendering XML.]]></description>
	</group>
	<group name="What is XSL?">
		<description><![CDATA[XSL (eXtensible Stylesheet Language) is a technology for transforming and style XML. XSL comprises of two main elements:
			<ul><li>A method for transforming XML documents</li>
			<li>A method for formatting XML documents.</li></ul>
		XSL can be used to define how an XML file should be displayed by transforming the XML file into HTML, a format that is recognizable to a browser. You can think of XSL as a language that can transform XML into HTML, a language that can filter and sort XML data and a language that can format XML data, based on the data value, like displaying the specified data in red color or bold and so forth.<p>XSL can also add completely new elements into the output file, or remove elements. It can re-order and sort the elements, test and make decisions about which elements to display, and a lot more.]]></description>
	</group>
	<group name="How to Associate XSL with an XML document">
		<description><![CDATA[XML documents are associated with a style sheet (in this case is XSL) using a processing instruction. This special type of element specifies to the browser or style engine.<p>Simply add a line of code into the XML document and make sure the reference file is in the same directory as XML document. Here is the magic line:
			<table border="1" width="100%">
        			<tr><td><p><font color="black" face="Tahoma" size="1">&lt;?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;filename.xsl&quot; ?&gt; </font></p></td></tr>
      		</table><p>
			<p>The attributes for this processing instruction are as follows:</p>
				<table border="1" width="99%">
					<tr><td><font size="1" color="black"><b>Attribute</b></font></td>
						<td><font size="1" color="black"><b>Description</b></font></td></tr>
					<tr><td><font size="1" color="black">href</font></td>
						<td><font size="1" color="black">Location of the style sheet. The value is a URI, and most of the time will be a URL.</font></td></tr>
					<tr><td><font size="1" color="black">type</font></td>
						<td><font size="1" color="black">The Style Sheet Language, expressed as a MIME type. For example, the XSL language MIME type is <em>type/xsl</em></font></td></tr>
					</table>
			<p>But wait, where are we going to place the code in XML document!!! Well, take a look at the example (cd_catalog1.xml) below: <br><br></p>
      		<table width="100%" border="0">
        		<tr valign="top"><td colspan="4"><font color="black" face="Tahoma" size="1">&lt;?xml 
            		version="1.0" ?><br>
            		&lt;?xml:stylesheet type=&quot;text/xsl&quot; href=&quot;cd_catalog.xsl&quot;?&gt;<br>
            		&lt;catalog></td></tr>
        		<tr valign="top"><td width="5%">&nbsp;</td><td colspan="3"><font color="black" face="Tahoma" size="1">&lt;cd></td></tr>
        		<tr valign="top"> 
          			<td width="5%">&nbsp;</td>
          			<td width="5%"></td>
          			<td colspan="2" width="90%"><font color="black" face="Tahoma" size="1">&lt;title>Painted 
            			Deserted Serenade&lt;/title><br>
            			&lt;artist>Joshue Kadison&lt;/artist><br>
            			&lt;country>USA&lt;/country><br>
            			&lt;company&gt;Capitol Records&lt;/company><br>
            			&lt;price>29.99&lt;/price><br>
            			&lt;year>1993&lt;/year></td></tr>
        			<tr valign="top"><td width="5%">&nbsp;</td><td colspan="3"><font color="black" face="Tahoma" size="1">&lt;/cd><br>&lt;cd> </font></td></tr>
					<tr valign="top"> 
          				<td width="5%">&nbsp;</td>
          				<td width="5%"></td>
          				<td colspan="2" width="90%"><font color="black" face="Tahoma" size="1">&lt;title>The 
            					Big Picture&lt;/title><br>
            					&lt;artist>Elton John&lt;/artist><br>
            					&lt;country>UK&lt;/country><br>
            					&lt;company>Mercury Records&lt;/company><br>
            					&lt;price>29.95&lt;/price><br>
            					&lt;year>1997&lt;/year></td></tr>
        			<tr valign="top"><td width="5%">&nbsp;</td><td colspan="3"><font color="black" face="Tahoma" size="1">&lt;/cd><br>&lt;cd></td></tr>
        			<tr valign="top"><td width="5%">&nbsp;</td><td width="5%"></td>
          				<td colspan="2" width="90%"><font color="black" face="Tahoma" size="1">
            				&lt;title>One night only&lt;/title><br>
            				&lt;artist>Bee Gees&lt;/artist><br>
            				&lt;country>UK&lt;/country><br>
            				&lt;company>Polydor&lt;/company><br>
            				&lt;price>29.99&lt;/price><br>
            				&lt;year>1999&lt;/year></td></tr>
        			<tr valign="top"><td width="5%">&nbsp;</td>
          				<td colspan="3"><font color="black" face="Tahoma" size="1">&lt;/cd><br>&lt;cd></td></tr>
        			<tr valign="top"><td width="5%"></td><td width="5%"></td>
          				<td colspan="2" width="90%"><font color="black" face="Tahoma" size="1">&lt;title&gt;Classic 
            				Hits&lt;/title><br>
            				&lt;artist>John Paul Young&lt;/artist><br>
            				&lt;country>AUST&lt;/country><br>
            				&lt;company>Albert Productions&lt;/company><br>
            				&lt;price>29.99&lt;/price><br>
            				&lt;year>1988&lt;/year></td></tr>
        			<tr valign="top"><td width="5%"></td><td width="5%"><font color="black" face="Tahoma" size="1">&lt;/cd&gt;<br>&lt;cd&gt; <br></td><td colspan="2" width="90%"></td></tr>
        			<tr valign="top"><td width="5%"></td><td width="5%"></td>
						<td colspan="2" width="90%"><font color="black" face="Tahoma" size="1">&lt;title&gt;Unchain 
            				My Heart&lt;/title&gt;<br>
            				&lt;artist&gt;Joe Crocker&lt;/artist&gt;<br>
            				&lt;country&gt;USA&lt;/country&gt;<br>
            				&lt;company&gt;EMI&lt;/company&gt;<br>
            				&lt;price&gt;14.99&lt;/price&gt;<br>
            				&lt;year&gt;1987&lt;/year&gt;</td></tr>
        			<tr valign="top"><td width="5%"></td><td colspan="3"><font color="black" face="Tahoma" size="1">&lt;/cd&gt;</td></tr>
        			<tr valign="top"><td colspan="4"><font color="black" face="Tahoma" size="1">&lt;/catalog></td></tr>
      			</table>
      			<p>Yep, simply put the stylesheet 
        		declaration after the version declaration and just before the document's<em> root element</em>.</p><p>From now on, we will use <a href="download/cd_catalog.xml" target="_blank"><font color="black"><b>cd_catalog.xml</b></font></a> as a foundation for us to build our XSL style sheets. So, remember to include <b>&lt;?xsl-stylesheet type=&quot;text/xsl&quot; href=&quot;cd_catalog.xsl&quot;?&gt;</b> into <b>cd_catalog.xml</b> document!</p><p></p>
			]]></description>
		</group>
		<group name="XSL - Transformation">
			<description><![CDATA[<p>XSL can be used to transform 
        	XML into HTML. How! Well, you actually build the HTML tags within XSL 
        	file. Take a look at the xsl code (cd_catalog.xsl) below:</font></p>
      		<table border="0" width="99%">
        		<tr valign="top"> 
          			<td><p><font face="Tahoma" color="black" size="1">1. &lt;?xml version='1.0'?&gt;<br>
              			2. &lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/TR/WD-xsl&quot;&gt;<br>
              			3. &lt;xsl:template match=&quot;/&quot;&gt;</font><font face="Tahoma" size="1"><br>
              			<font color="black"> 4.</font>&nbsp; <font color="#000066">&nbsp;&lt;html&gt;<br>
              			</font></font><font color="black" face="Tahoma" size="1"> 5.&nbsp;</font><font color="#000066" face="Tahoma" size="1"> 
              			&nbsp;&lt;body&gt;<br></font><font face="Tahoma" color="black" size="1"> 6.&nbsp;</font><font color="#000066" face="Tahoma" size="1">&nbsp;&nbsp; 
              			&nbsp;&nbsp;&nbsp;&lt;table border=&quot;2&quot; bgcolor=&quot;black&quot;&gt;<br>
              			</font><font color="black" face="Tahoma" size="1"> 7.&nbsp;&nbsp;&nbsp;</font><font color="#000066" face="Tahoma" size="1">&nbsp;&nbsp; 
              			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br>
              			</font><font color="black" face="Tahoma" size="1"> 8.</font><font color="#000066" face="Tahoma" size="1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
              			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;Title&lt;/th&gt;<br>
              			</font><font color="black" face="Tahoma" size="1"> 9.</font><font color="#000066" face="Tahoma" size="1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
              			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;th&gt;Artist&lt;/th&gt;<br>
              			</font><font color="black" face="Tahoma" size="1"> 10.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000066" face="Tahoma" size="1"> 
              			&nbsp;&nbsp;&nbsp;&lt;/tr&gt;</font><font face="Tahoma" size="1"><br>
              			<font color="black" size="1"> 11.&nbsp;&nbsp;&nbsp;&nbsp;</font>&nbsp; 
              			<font color="black" size="1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:for-each 
              			select=&quot;catalog/cd&quot;&gt;</font><br>
              			<font color="black" size="1"> 12.&nbsp;</font>&nbsp;&nbsp;&nbsp;&nbsp; 
              			<font color="#000066" size="1">&nbsp;&nbsp;&nbsp;&lt;tr&gt;</font><br>
              			<font color="black" size="1"> 13.&nbsp;&nbsp;</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
              			<font color="#000066" size="1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;</font></font><font color="black" face="Tahoma" size="1">&lt;xsl:value-of 
              			select=&quot;title&quot;/&gt;</font><font color="#000066" face="Tahoma" size="1">&lt;/td&gt;</font><font face="Tahoma" size="1"><br>
              			<font color="black" size="1"> 14.&nbsp;</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#000066">&nbsp; 
              			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;</font></font><font color="black" face="Tahoma" size="1">&lt;xsl:value-of 
              			select=&quot;artist&quot;/&gt;</font><font color="#000066" face="Tahoma" size="1">&lt;/td&gt;</font><font face="Tahoma" size="1"><br>
              			<font color="black" size="1"> 15.&nbsp;&nbsp;&nbsp;</font>&nbsp;&nbsp; 
              			<font color="#000066" size="1">&nbsp;&nbsp;&nbsp;&lt;/tr&gt;</font><br>
              			<font color="black" size="1"> 16.&nbsp;&nbsp;</font>&nbsp;&nbsp;&nbsp; 
              			<font color="black" size="1">&nbsp;&nbsp;&nbsp;&lt;/xsl:for-each&gt;</font><br>
              			<font color="black" size="1"> 17.&nbsp;&nbsp;&nbsp;</font></font> <font color="#000066" face="Tahoma" size="1">&nbsp;&lt;/table&gt;<br>
              			</font><font color="black" face="Tahoma" size="1"> 18.&nbsp; </font><font color="#000066" face="Tahoma" size="1">&lt;/body&gt;<br>
              			</font><font color="black" face="Tahoma" size="1"> 19.&nbsp;</font><font color="#000066" face="Tahoma" size="1"> 
              			&lt;/html&gt;</font><font face="Tahoma" size="1"><br>
              			<font color="black" size="1"> 20.</font></font> <font color="black" face="Tahoma" size="1">&lt;/xsl:template&gt;<br>
              			21. &lt;/xsl:stylesheet&gt;</font></p></td></tr>
      		</table><p><a href="download/cd_catalog.xsl" target="_blank"><font color="black">Open cd_catalog.xsl in IE5</font></a> or <a href="download/cd_catalog1.xml" target="_blank"><font color="black">Click here to see output</font></a></p>
			<p><font color="black" face="Tahoma"><img border="0" src="grafix/warn.gif" width="29" height="18"><font size="2">The 
        	line number above is for ease of tracking only, please do not include 
        	them in the xsl codes.</font></font></p>
      		<p><b>Explanation:</b></font></p>
      		<p><b>Line 1.</b> Since an 
        	XSL style sheet is an XML file itself, so XSL is case sensitive and the file is therefore must begin 
        	with an xml declaration</font></p>
      		<p><b>Line 2.</b> The <b>xsl:stylesheet</b> 
        	element indicates that this document is a style sheet. If you add a reference 
        	to the above stylesheet to your original XML document, your browser will 
        	nicely <b>transform</b> your XML document into HTML.</font></p>
      		<p><b>Line 3.</b> The template has also been wrapped with <b>xsl:template match="/"</b> to indicate that 
        	this is a template that corresponds to the root (/) of the XML source document.</font></p>
      		<p><blockquote><li><b>xsl:for-each</b> element locates elements in the XML document and repeats a template for 
        	each one.</li><li>The <b>select</b> attribute describes the element in the source 
        	document. The syntax for this attribute is called an <b>XSL Pattern</b>, 
        	and works like navigating a file system</li><li>A <b> forward slash (/)</b> 
        	selects subdirectories. The <b>xsl:value-of</b> element selects a child 
        	in the hierarchy and inserts the content of that child into the template.</font></p></blockquote>
      		<p>The rest of the codes you should be able to recognise 'em right!</font></p><p></p>
		]]></description>
		</group>		
		<group name="XSL - Sort"><description><![CDATA[<p>One of the beauties of XSL 
        is to output the XML file as an ordinary HTML file and sort it at the 
        same time. All we have to do is simply add an <b>order-by</b> attribute 
        to <b> for-each</b> element in XSL file. Let's say we would like to sort 
        by <b>Artist</b> okay, here is the snipe code:</font></p>
      	<p>&lt;xsl:for-each 
        select=&quot;catalog/cd&quot; order-by="+ artist&quot;&gt;</font></b></font></p>
      	<p>The <b> order-by</b> attributes 
        takes a <b> plus (+) </b> or<b> minus (-)</b> sign, to define an<b> ascending 
        </b> or <b> descending</b> sort order respectively, and an element name 
        to define the sort element.</font></p>
      	<p>Now take a look at your slightly adjusted XSL stylesheet.</p>
      	<table width="99%" border="0">
        	<tr valign="top"> 
          	<td><font color="black" face="Tahoma" size="1">&lt;?xml 
            version='1.0'?&gt;<br>
            &lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/TR/WD-xsl&quot;&gt;<br>
            &lt;xsl:template match=&quot;/&quot;&gt;<br>
            &nbsp; &nbsp;&nbsp;&lt;html&gt;<br>
            &nbsp; &nbsp;&nbsp;&lt;body&gt;<br>
            &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;table border=&quot;2&quot; 
            bgcolor=&quot;black&quot;&gt;<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;Title&lt;/th&gt;<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;Artist&lt;/th&gt;<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:for-each 
            select=&quot;catalog/cd&quot; order-by=&quot;+ artist&quot;&gt;<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;xsl:value-of 
            select=&quot;title&quot;/&gt;&lt;/td&gt;<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;xsl:value-of 
            select=&quot;artist&quot;/&gt;&lt;/td&gt;<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:for-each&gt;<br>
            &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/table&gt;<br>
            &nbsp; &lt;/body&gt;<br>
            &nbsp; &lt;/html&gt;<br>
            &lt;/xsl:template&gt;<br>
            &lt;/xsl:stylesheet&gt;</font></td></tr>
      	</table><p><a href="download/cd_catalog2.xsl" target="_blank"><font color="black">
        Open it with IE 5</a></font> or <a href="download/cd_catalog2.xml" target="_blank"><font color="black">Click here to see output</font></a><p>As you can see, the Artist column has been sorted alphabetically.</p><p></p>
		]]></description>
		</group>
		<group name="XSL - Filter Query"><description><![CDATA[<p>With XSL, we should be able 
        to write the codes for it to filter information very easily. Simply add 
        a filter to the selected attribute in your <b> for-each</b> element in 
        XSL file like so:</p>
      	<table border="1" width="100%">
        <tr><td><p><b><font color="black" face="Tahoma" size="2">&lt;xsl:for-each 
              select=&quot;catalog/cd[artist='John Paul Young']"&gt;</font></b></p></td></tr>
      	</table>
      	<p>Now take a look at your slightly adjusted XSL stylesheet.</p>
      <table border=0 width="100%">
        <tr valign="top"><td> 
            <p><font color="black" face="Tahoma" size="1">&lt;?xml version='1.0'?&gt;<br>
              &lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/TR/WD-xsl&quot;&gt;<br>
              &lt;xsl:template match=&quot;/&quot;&gt;<br>
              &lt;html&gt;<br>
              &lt;body&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;table border=&quot;2&quot; 
              bgcolor=&quot;black&quot;&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;Title&lt;/th&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;Artist&lt;/th&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:for-each 
              select=&quot;catalog/cd[artist='John Paul Young']&quot;&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;xsl:value-of 
              select=&quot;title&quot;/&gt;&lt;/td&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;xsl:value-of 
              select=&quot;artist&quot;/&gt;&lt;/td&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:for-each&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/table&gt;<br>
              &lt;/body&gt;<br>
              &lt;/html&gt;<br>
              &lt;/xsl:template&gt;<br>
              &lt;/xsl:stylesheet&gt;</font></p></td></tr>
      	</table><p><a href="download/cd_catalog_filter.xsl"><font color="black">Open 
        it with IE5</a></font> or <a href="download/cd_catalog_filter.xml" target="_blank"><font color="black">Click here to see output</font></a><p></p>In this case, only Artist "John Paul Young" has been selected<p><p></p>
      	<p>Like any other programming language, XSL has four legal filter operators, those are:</font></p>
      	<table border="1" width="44%">
        	<tr><td width="30%"><font color="black" size="2"><b>Operator</font></b></td>
          		<td width="70%"><font color="black" size="2"><b>Meaning</font></b></td></tr>
        	<tr><td width="30%"><font color="black" size="2">=&nbsp;</font></td>
          		<td width="70%"><font color="black" size="2">Equal</font></td></tr>
        	<tr><td width="30%"><font color="black" size="2">!=</font></td>
          		<td width="70%"><font color="black" size="2">Not equal</font></td></tr>
        	<tr><td width="30%"><font color="black" size="2">&amp;lt;</font></td>
          		<td width="70%"><font color="black" size="2">Less than</font></td></tr>
        	<tr><td width="30%"><font color="black" face="Tahoma" size="2">&amp;gt;</font></td>
          		<td width="70%"><font color="black" face="Tahoma" size="2">Greater than</font></td></tr>
      	</table><p></p>
		]]></description>
	</group>
	<group name="XSL Conditional IF">
		<description><![CDATA[<p>Let us try to use Condition IF (<b>xsl:if</b>) 
        test to filter information from and XML document. Here is the code:</font></p>
      	<table width="99%" border="1" cellpadding="0" bordercolorlight="black" bordercolordark="black" bordercolor="black">
        	<tr><td><b><font face="Tahoma" color="black" size="2">&lt;xsl:if match=&quot;.[artist='John 
            	Paul Young']"&gt;<br>
            	... some output ...<br>
            	&lt;/xsl:if&gt;</font></b></td></tr>
      	</table>
      	<p>Now take a look at your slightly adjusted XSL stylesheet.</font></p>
      	<table border=0 width="100%">
        	<tbody> 
        	<tr valign="top"><td> 
            	<p><font face="Tahoma" size="1" color="black">&lt;?xml version='1.0'?&gt;<br>
              &lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/TR/WD-xsl&quot;&gt; 
              <br>
              &lt;xsl:template match=&quot;/&quot;&gt;<br>
              &lt;html&gt;<br>
              &lt;body&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;table border=&quot;2&quot; 
              bgcolor=&quot;black&quot;&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;Title&lt;/th&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;Artist&lt;/th&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:for-each 
              select=&quot;catalog/cd&quot;&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:if 
              match=&quot;.[artist='John Paul Young']&quot;&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;xsl:value-of 
              select=&quot;title&quot;/&gt;&lt;/td&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;xsl:value-of 
              select=&quot;artist&quot;/&gt;&lt;/td&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:if&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:for-each&gt;<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/table&gt;<br>
              &lt;/body&gt;<br>
              &lt;/html&gt;<br>
              &lt;/xsl:template&gt;<br>
              &lt;/xsl:stylesheet&gt;</font></p></td></tr>
        	</tbody> 
      	</table><p><a href="download/cd_catalog_if.xsl"><font color="black">Open it with IE5</a></font> or <a href="download/cd_catalog_if.xml" target="_blank"><font color="black">Click here to see output</font></a><p></p>As you can see, using different technique, we still can achive the same result<p></p>
	]]></description>
	</group>
	<group name="XSL Conditional Choose">
		<description><![CDATA[<p>If you think using IF test to filter information 
        is good enough. Well, think again!!! XSL in fact can do more than that 
        such as: using a conditional choose to filter an XML document. Again, 
        the code is very simple.</p>
      	<p>To insert an <b>conditional choose</b> test 
        against the content of the file, simply add the <b>xsl:choose</b>, <b>xsl:when</b> 
        and <b>xsl:otherwise</b> elements to your XSL document like this:</font></p>
      	<table width="99%" border="1" cellpadding="0">
        	<tr valign="top"> 
          	<td><b><font face="Tahoma" color="black" size="1">&lt;xsl:choose&gt;<br>
            &nbsp;&nbsp; &lt;xsl:when match=&quot;.[artist='John Paul Young']"&gt;<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ... some code ...<br>
            &nbsp;&nbsp; &lt;/xsl:when&gt;<br>
            &nbsp;&nbsp; &lt;xsl:otherwise&gt;<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ... some code ....<br>
            &nbsp;&nbsp; &lt;/xsl:otherwise&gt;<br>
            &lt;/xsl:choose&gt;</font></b></td>
        </tr>
      	</table>
      	<p>Now take a look at your slightly adjusted XSL stylesheet.</p>
      	<table border=0 width="99%">
        	<tr valign="top"> 
          		<td> 
            	<p><font face="Tahoma" color="black" size="1">&lt;?xml version='1.0'?&gt;<br>
              	&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/TR/WD-xsl&quot;&gt;<br>
              	&lt;xsl:template match=&quot;/&quot;&gt;<br>
              	&lt;html&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;body&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;table 
              	border=&quot;2&quot; bgcolor=&quot;black&quot;&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
              	&lt;th&gt;Title&lt;/th&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
              	&lt;th&gt;Artist&lt;/th&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:for-each 
              	select=&quot;catalog/cd&quot;&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;xsl:value-of 
              	select=&quot;title&quot;/&gt;&lt;/td&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:choose&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:when 
              	match=&quot;.[artist='John Paul Young']&quot;&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td 
              	bgcolor=&quot;red&quot;&gt; &lt;xsl:value-of select=&quot;artist&quot;/&gt;&lt;/td&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:when&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:otherwise&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;xsl:value-of 
              	select=&quot;artist&quot;/&gt;&lt;/td&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:otherwise&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:choose&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:for-each&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/table&gt;<br>
              	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/body&gt;<br>
              	&lt;/html&gt;<br>
              	&lt;/xsl:template&gt;<br>
              	&lt;/xsl:stylesheet&gt;</font></p></td></tr>
      	</table><p><a href="download/cd_catalog_choose.xsl" target="_blank"><font color="black">Open 
        	it with IE5</a> or </font><a href="download/cd_catalog_choose.xml" target="_blank"><font color="black">Click here to see output</font></a><p>By using the conditional choose, we can select a specific artist and display it in <font color="red">red </font> color</p><p></p>
		]]></description>
	</group>
</category>
</body>
</head>
</html>
</tutorial>
