Introduction   to XSLT
   XML       XML Namespaces       HTML       XHTML       XSL       XPath       XSLT : What it do ? How it do it?   ...
   XML stands for eXtensible Markup Language   eXtensible which means that tags are not    predefined Extensible means t...
  A "Well Formed" XML document has correct   XML syntax.The syntax rules are :  XML documents must have a root element ...
Name Conflicts  In XML, element names are defined by the developer. This often   results in a conflict when trying to mix...
   <h:table>     <h:tr>      <h:td>Apples</h:td>      <h:td>Bananas</h:td>     </h:tr>    </h:table>    <f:table>     <f:...
   <root    xmlns:h="http://www.w3.org/TR/html4/"    xmlns:f="http://www.w3schools.com/furniture">    <h:table>     <h:tr...
   Defining a default namespace for an element    saves us from using prefixes in all the child    elements. It has the f...
   HTML stands    for Hyper Text Markup Language   HTML is not a programming language, it is    a markup language   The...
   XHTML stands for EXtensible HyperText    Markup Language   Well formed HTML
  XSL stands for   EXtensible Stylesheet Language.  XSL = Style Sheets for XMLXSL describes how the XMLdocument should b...
   Styling is both about transforming and    formatting information. When the World Wide Web    Consortium (W3C) made the...
   XPath, the XML Path Language, is a query    language for selecting nodes from    an XML document.   The XPath languag...
   XSLT is used to transform an XML document    into another XML document, or another type    of document that is recogni...
   In the transformation process, XSLT uses    XPath to define parts of the source document    that should match one or m...
   <xsl:stylesheet version="1.0"    xmlns:xsl="http://www.w3.org/1999/XSL/Tra    nsform">
   The <xsl:template> Element   The <xsl:template> element is used to build    templates.   The match attribute is used...
Introduction to XSLT
Upcoming SlideShare
Loading in …5
×

Introduction to XSLT

692 views

Published on

Introduction to XSLT by introducting XML,XHTML. XPath, XSL

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
692
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
30
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • A &quot;Valid&quot; XML document is a &quot;Well Formed&quot; XML document, which also conforms to the rules of a Document Type Definition (DTD):The purpose of a DTD is to define the structure of an XML document. It defines the structure with a list of legal elements:
  • XHTML is almost identical to HTML 4.01XHTML is a stricter and cleaner version of HTMLXHTML is HTML defined as an XML applicationXHTML is a W3C Recommendation of January 2000.XHTML is supported by all major browsers.XHTML elements must be properly nestedXHTML elements must always be closedXHTML elements must be in lowercaseXHTML documents must have one root element
  • An XSL style sheet is, like with CSS, a file that describes how to display an XML document of a given type.
  • In addition, XPath may be used to compute values (e.g., strings, numbers, or Boolean values) from the content of an XML document
  • XSLT :Originally intended to perform complex styling operations, like the generation of tables of contents and indexes, it is now used as a general purpose XML processing language. XSLT is thus widely used for purposes other than XSL, like generating HTML web pages from XML data.
  • An XSL style sheet consists of one or more set of rules that are called templates.A template contains rules to apply when a specified node is matched
  • Introduction to XSLT

    1. 1. Introduction to XSLT
    2. 2.  XML  XML Namespaces  HTML  XHTML  XSL  XPath  XSLT : What it do ? How it do it?  XSLT :Demo - example  Q&A2 HP Restricted HP Restricted 1/1/2013 2
    3. 3.  XML stands for eXtensible Markup Language eXtensible which means that tags are not predefined Extensible means that there is no fixed tag set (like in HTML) Markup Language : is a set of markup tags. XML was created to structure, store, and transport information. XML is designed to be self-descriptive
    4. 4.  A "Well Formed" XML document has correct XML syntax.The syntax rules are :  XML documents must have a root element  XML elements must have a closing tag  XML tags are case sensitive  XML elements must be properly nested  XML attribute values must be quoted
    5. 5. Name Conflicts  In XML, element names are defined by the developer. This often results in a conflict when trying to mix XML documents from different XML applications.  This XML carries HTML table information:<table> <tr> <td>Apples</td> <td>Bananas</td> </tr></table>  This XML carries information about a table (a piece of furniture):<table> <name>African Coffee Table</name> <width>80</width> <length>120</length></table>
    6. 6.  <h:table> <h:tr> <h:td>Apples</h:td> <h:td>Bananas</h:td> </h:tr> </h:table> <f:table> <f:name>African Coffee Table</f:name> <f:width>80</f:width> <f:length>120</f:length> </f:table>
    7. 7.  <root xmlns:h="http://www.w3.org/TR/html4/" xmlns:f="http://www.w3schools.com/furniture"> <h:table> <h:tr> <h:td>Apples</h:td> <h:td>Bananas</h:td> </h:tr> </h:table> <f:table> <f:name>African Coffee Table</f:name> <f:width>80</f:width> <f:length>120</f:length> </f:table> </root>
    8. 8.  Defining a default namespace for an element saves us from using prefixes in all the child elements. It has the following syntax:xmlns="namespaceURI“This XML carries information about a piece offurniture:<table xmlns="http://www.w3.org/TR/html4/"> <tr> <td>Apples</td> <td>Bananas</td> </tr></table>
    9. 9.  HTML stands for Hyper Text Markup Language HTML is not a programming language, it is a markup language The tags of HTML is predefined markup tags
    10. 10.  XHTML stands for EXtensible HyperText Markup Language Well formed HTML
    11. 11.  XSL stands for EXtensible Stylesheet Language.  XSL = Style Sheets for XMLXSL describes how the XMLdocument should be displayed!
    12. 12.  Styling is both about transforming and formatting information. When the World Wide Web Consortium (W3C) made their first XSL Working Draft, it contained the language syntax for both transforming and formatting XML documents. Later, the Working Group at W3C split the original draft into separate Recommendations: * XSLT, a language for transforming XML documents * XSL-FO, a language for formatting XML documents * XPath, a language for navigating in XML documents
    13. 13.  XPath, the XML Path Language, is a query language for selecting nodes from an XML document. The XPath language is based on a tree representation of the XML document, and provides the ability to navigate around the tree, selecting nodes by a variety of criteria
    14. 14.  XSLT is used to transform an XML document into another XML document, or another type of document that is recognized by a browser, like HTML and XHTML. Normally XSLT does this by transforming each XML element into an (X)HTML element.
    15. 15.  In the transformation process, XSLT uses XPath to define parts of the source document that should match one or more predefined templates. When a match is found, XSLT will transform the matching part of the source document into the result document.
    16. 16.  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Tra nsform">
    17. 17.  The <xsl:template> Element The <xsl:template> element is used to build templates. The match attribute is used to associate a template with an XML element. The match attribute can also be used to define a template for the entire XML document. The value of the match attribute is an XPath expression (i.e. match="/" defines the whole document). <xsl:template match="/"> ----------</ xsl:template >

    ×