XSL/XSLT
XSL/XSLT
XSL
XSL which stands for EXtensible Stylesheet Language.
It is similar to XML as CSS is to HTML.
Tags are predefined in HTML but in case of XML documents, tags are not
predefined.
In order to understand and style an XML document, World Wide Web Consortium
(W3C) developed XSL which can act as XML based Stylesheet Language.
An XSL document specifies how a browser should render an XML document.
XSL describes how the XML elements should be displayed.
The main parts of XSL
XSLT − used to transform XML document into various other types of document.
XPath − used to navigate XML document.
XSL-FO − used to format XML document
What is XSLT
XSLT, Extensible Stylesheet Language Transformations, provides the ability to transform
XML data from one format to another automatically.
An XSLT stylesheet is used to define the transformation rules to be applied on the target XML
document.
XSLT stylesheet is written in XML format.
XSLT Processor takes the XSLT stylesheet and applies the transformation rules on the target
XML document and then it generates a formatted document in the form of XML, HTML, or
text format.
This formatted document is then utilized by XSLT formatter to generate the actual output
which is to be displayed to the end-user.
How it works
Advantages
It consumes more memory (if the XML structure is large) as program written once
remains in memory all the time until and unless removed explicitly.
Due to the extensive usage of memory, its operational speed, compared to SAX is
slower.
SAX(Simple API for XML)
SAX (Simple API for XML) is an application program interface (API) that allows a
programmer to interpret a Web file that uses the Extensible Markup Language (XML)
- that is, a Web file that describes a collection of data.
SAX is an alternative to using the Document Object Model (DOM) to interpret the
XML file.
As its name suggests, it's a simpler interface than DOM and is appropriate where
many or very large files are to be processed, but it contains fewer capabilities for
manipulating the data content.
SAX is an event-driven interface
SAX works directly with an XML parser.
SAX vs DOM