Extensible Stylesheet language (XSL) is a language used to
express style sheets. You use XSL to define how data should be displayed,
styled and laid out. It was developed with the need of creating XML based
Stylesheet language.
XSL is based on three concepts as described below.
·
Extensible Stylesheet Language Transformation (XSLT) is a
language to transform the xml document into html, text or even another xml
file.
·
XPath is a language to navigate through elements, attributes and
elements' values in xml documents.
·
Extensible Stylesheet Language Formatting (XSL:FO) is a language
for formatting xml documents.
This article assumes that you have a minimum understanding
of the XSL functionality in order to keep up with this demonstration. For more
information please visit http://www.w3schools.com/xsl/xsl_intro.asp.
In this article we will create a horizontal menu. This menu
contains main items. Once any item is clicked, sub items will be shown or
hidden beneath the item clicked. All the items and sub items are being read
from an XML document which makes modifying the menu an easy job to do.
To create this menu we have to complete the following steps.
·
Create an XML document containing the items and sub items to be
shown in the menu.
·
Create an XSL file which will navigate through the XML document.
Add C# code that will transform the XSL and the XML into an
HTML document or use the XML server control found in ASP.NET.