Home » XML Basics » 11 - XSL
11

What is XSL

Extensible Style Sheet Language is something that you need to learn about to know more abou style sheets. The purpose of this is to make XML files readable by the browser. This introductory section will give you this information and more, like how a basi XSL syntax runs.

XSL stands for Extensible Style Sheet Language. It was designed primarily for styling XML files. XSLT is the most important part of XSL and it stands for XSL transformations. XSLT basically turns an XML file into another XML file, an HTML file, or an XHTML file. You may ask why? The basic reason is for XML to be readable by the browser. XSLT does all it can to make this possible. XSLT uses XPath to navigate through XML documents.

Basic XSL Syntax

The first thing that you do with your file is to declare it as an XSL file. You can do this by stating either of the two codes below.

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

OR

<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

Remember to close these tags at the end of the file since it is in XML!

You can use the following commands to access files in an XML document.

<xsl:template match="...">
makes a template that will match the stated values.

<xsl:for-each select="...">
selects a directory to work on.

<xsl:value-of select="..."/>
inserts a value into the template.