XSL, eXtensible Stylesheet Language is a W3C standard with lots of development and momentum and having a large size of community also got abundant number of Books, mailing lists, training and websites. This article just gives a kick start for the people who want to work with XSL and XPath.
What is XSL?
Let us start with the question what actually is XSL and what it has got within it.
- XSL is the style sheet language of XML.
- XSL is a declarative language.
- XSL is not a general regular expression language for transformation of arbitrary data.
- Actually, transforms XML into a tree, then turns that tree into another tree, then outputs that tree as XML.
- XSLT is based upon templates.
- Every XSL must have at least one template.
- XSLT is a declarative language, where we declare that what output should be produced when a specified pattern in our stylesheet is met.
XSL actually consists of three languages
1. XSLT: Language to transform XML
2. XPath: Language to define XML parts or patterns
3. XSL Formatting Objects: Language to define XML display
Ok, I agree that XSL has got so many things within it but why do I require it. Well, the following paragraph gives an attempt to answer the question why do you require XSL.
- When XML needs to be transformed to HTML or to another format of XML itself.
- When the XML data needs to be filtered and sorted.
- When it needs to address parts of an xml document.
- When it needs to format the xml data, based on the data value, like displaying all odd numbers in blue color etc....
- When it needs to output xml data to different devices like screen, or voice.