SlideShare a Scribd company logo
1 of 18
Introduction   to XSLT
   XML
       XML Namespaces
       HTML
       XHTML
       XSL
       XPath
       XSLT : What it do ? How it do it?
       XSLT :Demo - example
       Q&A




2                HP Restricted        HP Restricted   1/1/2013   2
   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
  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
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>
   <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
    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>
   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 of
furniture:
<table xmlns="http://www.w3.org/TR/html4/">
 <tr>
   <td>Apples</td>
   <td>Bananas</td>
 </tr>
</table>
   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
   XHTML stands for EXtensible HyperText
    Markup Language
   Well formed HTML
  XSL stands for
   EXtensible Stylesheet Language.
  XSL = Style Sheets for XML
XSL describes how the XML
document should be displayed!
   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
   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
   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.
   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.
   <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 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 >

More Related Content

What's hot (19)

Xslt
XsltXslt
Xslt
 
transforming xml using xsl and xslt
transforming xml using xsl and xslttransforming xml using xsl and xslt
transforming xml using xsl and xslt
 
XSLT and XPath - without the pain!
XSLT and XPath - without the pain!XSLT and XPath - without the pain!
XSLT and XPath - without the pain!
 
XML and XSLT
XML and XSLTXML and XSLT
XML and XSLT
 
Xslt by asfak mahamud
Xslt by asfak mahamudXslt by asfak mahamud
Xslt by asfak mahamud
 
XSLT presentation
XSLT presentationXSLT presentation
XSLT presentation
 
Querring xml with xpath
Querring xml with xpath Querring xml with xpath
Querring xml with xpath
 
XML XSLT
XML XSLTXML XSLT
XML XSLT
 
Xslt
XsltXslt
Xslt
 
XMLT
XMLTXMLT
XMLT
 
5 xsl (formatting xml documents)
5   xsl (formatting xml documents)5   xsl (formatting xml documents)
5 xsl (formatting xml documents)
 
Displaying XML Documents Using CSS and XSL
Displaying XML Documents Using CSS and XSLDisplaying XML Documents Using CSS and XSL
Displaying XML Documents Using CSS and XSL
 
03 x files
03 x files03 x files
03 x files
 
Xml p5 Lecture Notes
Xml p5 Lecture NotesXml p5 Lecture Notes
Xml p5 Lecture Notes
 
eXtensible Markup Language (XML)
eXtensible Markup Language (XML)eXtensible Markup Language (XML)
eXtensible Markup Language (XML)
 
Xml Lecture Notes
Xml Lecture NotesXml Lecture Notes
Xml Lecture Notes
 
Xml part4
Xml part4Xml part4
Xml part4
 
Xml part5
Xml part5Xml part5
Xml part5
 
Xml schema
Xml schemaXml schema
Xml schema
 

Viewers also liked

Viewers also liked (7)

XML Schema (W3C)
XML Schema (W3C)XML Schema (W3C)
XML Schema (W3C)
 
XML Schema
XML SchemaXML Schema
XML Schema
 
JavaScript: Events Handling
JavaScript: Events HandlingJavaScript: Events Handling
JavaScript: Events Handling
 
Java script
Java scriptJava script
Java script
 
Event handling
Event handlingEvent handling
Event handling
 
Javascript
JavascriptJavascript
Javascript
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 

Similar to Introduction to XSLT (20)

Xslt
XsltXslt
Xslt
 
Xml transformation language
Xml transformation languageXml transformation language
Xml transformation language
 
Xml andweb services
Xml andweb services Xml andweb services
Xml andweb services
 
Xml
XmlXml
Xml
 
paper about xml
paper about xmlpaper about xml
paper about xml
 
1 xml fundamentals
1 xml fundamentals1 xml fundamentals
1 xml fundamentals
 
eXtensible Markup Language
eXtensible Markup LanguageeXtensible Markup Language
eXtensible Markup Language
 
Xml iet 2015
Xml iet 2015Xml iet 2015
Xml iet 2015
 
xml.pptx
xml.pptxxml.pptx
xml.pptx
 
Xml
XmlXml
Xml
 
Web programming xml
Web programming  xmlWeb programming  xml
Web programming xml
 
Xml intro1
Xml intro1Xml intro1
Xml intro1
 
Integrative Programming and Technology Chapter 4- Dr. J. VijiPriya
Integrative Programming and Technology Chapter 4- Dr. J. VijiPriyaIntegrative Programming and Technology Chapter 4- Dr. J. VijiPriya
Integrative Programming and Technology Chapter 4- Dr. J. VijiPriya
 
light_xml
light_xmllight_xml
light_xml
 
Overview of XSL, XPath and XSL-FO
Overview of XSL, XPath and XSL-FOOverview of XSL, XPath and XSL-FO
Overview of XSL, XPath and XSL-FO
 
XPATH_XSLT-1.pptx
XPATH_XSLT-1.pptxXPATH_XSLT-1.pptx
XPATH_XSLT-1.pptx
 
Introduction of xml and xslt
Introduction of xml and xsltIntroduction of xml and xslt
Introduction of xml and xslt
 
Unit 2.2
Unit 2.2Unit 2.2
Unit 2.2
 
Xml presentation
Xml presentationXml presentation
Xml presentation
 
XML1.pptx
XML1.pptxXML1.pptx
XML1.pptx
 

Recently uploaded

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 

Recently uploaded (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 

Introduction to XSLT

  • 1. Introduction to XSLT
  • 2. XML  XML Namespaces  HTML  XHTML  XSL  XPath  XSLT : What it do ? How it do it?  XSLT :Demo - example  Q&A 2 HP Restricted HP Restricted 1/1/2013 2
  • 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.  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. 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. <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. <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. 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 of furniture: <table xmlns="http://www.w3.org/TR/html4/"> <tr> <td>Apples</td> <td>Bananas</td> </tr> </table>
  • 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. XHTML stands for EXtensible HyperText Markup Language  Well formed HTML
  • 11.  XSL stands for EXtensible Stylesheet Language.  XSL = Style Sheets for XML XSL describes how the XML document should be displayed!
  • 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. 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. 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. 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.
  • 17. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Tra nsform">
  • 18. 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 >

Editor's Notes

  1. 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:
  2. 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
  3. An XSL style sheet is, like with CSS, a file that describes how to display an XML document of a given type.
  4. In addition, XPath may be used to compute values (e.g., strings, numbers, or Boolean values) from the content of an XML document
  5. 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.
  6. 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