XSL(T) Languages

  • XSLT: The language for transforming XML documents.
  • XPath: The language for navigating in XML documents.
  • XQuery: The language for querying XML documents.

Starting with XSL:

XSL or EXtensible Stylesheet Language was developed by the World Wide Web Consortium, also known as W3C, as there was a necessity for an XML-based Stylesheet Language.

CSS is the Style Sheets for HTML:

To add styles to HTML elements, CSS is used. The predefined tags are used by HTML, where, the meaning of, and the way to display each tag is well understood.

XSL is the Style Sheets for XML:

With no predefined tags, the meaning of each tag is not well defined in XML. A single element could indicate many different things, and the browsers do not know how to display the elements. The way to display the XML elements is thus described by XSL.

XSL – More Than a Style Sheet Language:

There are four parts of XSL:

  • The language for transforming XML documents: XSLT
  • The language for navigating in XML documents: XPath
  • The language for formatting XML documents: XSL-FO. It was discontinued in 2013.
  • The language for querying XML documents: XQuery

W3C has delivered a new standard for document formatting with the CSS3 Paged Media Module. The XSL-FO replacement is thus proposed to be CSS3, since 2013.

What is XSLT?

XSLT or XSL Transformations is the most important part of XSL because it transforms an XML document into another XML document and is a W3C Recommendation. To navigate in XML documents, it uses XPath.

XSLT = XSL Transformations:

What makes XSLT the most important part of XSL is its feature to transform an XML document into another XML document, or another type of document. The necessary part is that the document should be recognized by a browser, like HTML and XHTML. Usually, each XML element is transformed into an (X)HTML element. XSLT thus, transforms the XML source-tree into an XML result-tree. To add or remove elements and the attributes to or from the output file, rearrange and sort elements, perform tests and make decisions about which elements to hide and display, and many more, we can use XSLT.

XSLT Uses XPath:

To find information in an XML document, i.e., to navigate through elements and attributes in XML documents, XSLT uses XPath.

How Does it Work?

To define parts of the source document that should match one or more predefined templates, XSLT uses XPath and on finding a match the matching part of the source document is transformed into the result document by XSLT.

XSLT Browser Support:

XSLT and XPath are supported by all major browsers.

XSLT is a W3C Recommendation:

On 16 November 1999., XSLT became a W3C Recommendation.

Please Share