XSLT eXtensible Stylesheet Language Transformations Naveed Arshad
Agenda What is XSL, XSLT and Xpath Advantages of XSLT XSLT Architecture XSLT Processing Model An Example of XSLT Current State of XSLT References
What is XSL, XSLT and Xpath? Started of with XSL (eXtensible Stylesheet Language) – For XML TRANSFORMATION and FORMATING XSLT for TRANSFORMATIONS and XSL for “ the rest ”
What is XSL, XSLT and Xpath? (cont ’ d) Significant overlap in – Expression Syntax of XSLT – Linking one document to the another using XPointer Two committees joined hands to make it one language – XPATH Example
Advantages of XSLT Transformation from – XML document to another XML document – XML document to an HTML document – XML document to any text form ;-)
XSLT Architecture Source Tree as Input Result Tree as Output XSLT processor takes two inputs – XSL style sheet – XML Document as Source Tree
XSLT Processing Model Input in form of a tree thus inherently a – Recursive Process – Checks for template when a new item is encountered – Transform source nodes into result nodes – Rearranges the items based on style sheet
XSLT Example XML to XML Takes one XML document as Source Tree Apply templates using XSLT stylesheet Transforms it into another XML document as a Result Tree
Input: XML DOCUMENT (Source Tree) Designing Distributed Applications Stephen Mohr May $49.99
Professional ASP 3.0 Alex Homer Brian Francis David Sussman October $59.99
XSLT Stylesheet
,
Output: XML Document (Result Tree) Designing Distributed Applications, May1999 Professional ASP 3.0, October 1999
XSLT Processors ProcessorAverage % Score Napa MSXML SUN XSLTC Beta XT64.24 Saxon Resin 1.2b Xalan Java 2.0.D Sabletron Oracle Java V Xalan C Xalan Java Source:
What about CSS and CSS2 CSS lacks the ability to format the ouput Rule of thumb – CSS is used at the Client End – XSLT is used on the Server End
Current Status of XSLT As of Sep 12 th, 2001 XSLT 1.0 is part of the XML family Recommendations XSLT 1.1 working draft is released on Aug 23 rd 2002 – will be the basis of XSLT 2.0
References XSLT Programmer ’ s Reference – XSLT Quick Referance – XSLT Specifications – XSLT News and Resrources –