SlideShare a Scribd company logo
2
Most read
6
Most read
11
Most read
XSL
XML STYLE SHEET LANGUAGE
SARASWATHI RAMALINGAM
SRI AKILANDESWARI WOMENS COLLEGE
XSL
• XSL has two independent languages:
– The XSL Transformation Language (XSLT)
– The XSL Formatting Object Language
(XSL-FO)
• XSLT is used to convert an XML document
to another format.
• XSL-FO provides a way of describing the
presentation of an XML document.
book.xml
<?xml version=”1.0”?>
<book>
<author>Michael Daconta et al</author>
<title>XML Development with Java 2</title>
<category>Java</category>
<price currency=”USD”>44.99</price>
<summary>
XML Development with Java 2 provides the information
and techniques a Java developer will need to integrate
XML into Java-based applications.
</summary>
</book>
book.xml
• In this example, we will apply the style
sheet in a client-side Web browser.
• The XML document makes a reference to a
style sheet using the following code:
<?xml-stylesheet type=”text/xsl”
href=”book_view.xsl”?>
Creating the XSL Style Sheet
<?xml version=”1.0”?>
<xsl:stylesheet xmlns:xsl=”URI” version=”1.0”>
<!--XSL-T CONVERSION RULES-->
</xsl:stylesheet>
• The <xsl:stylesheet> element defines how
the XSLT processor should process the
current XSL document.
• The xmlns attribute is the namespace
definition.
• The XSL Transformation engine reads the
xmlns attribute and determines whether it
supports the given namespace.
• The xmlns attribute specifies the XSL prefix.
• All XSL elements and types in the document use the
prefix.
• The xmlns attribute value contains a Uniform Resource
Identifier (URI), which serves as a generic method for
identifying entities on the World Wide Web.
• It is important to note that the XSLT processor will not
connect to the URI; it simply compares the URI against
a collection of URIs that it supports.
• The XSL style sheet contains HTML text
and XSL elements.
• The HTML text forms the basis of the
desired output page.
• The XSL elements are template rules for the
XSLT processor.
• A template is associated with a given
element in the XML document.
• In our example, a template is defined
to match on the <book> element using
the following code:
<xsl:template match=”/book”>
<!--static text and xsl rules -->
</xsl:template>
• XSLT defines the <xsl:value-of> element for
retrieving data from a XML document.
• The <xsl:value-of> element contains a select
attribute.
• This attribute value is the name of the actual
XML element you want to retrieve.
For example
<xsl:value-of select=”title” />
book_view.xsl
<?xml version=”1.0”?>
<xsl:stylesheet xmlns:xsl=”http://www.w3.org/1999/XSL/Transform” version=”1.0”>
<xsl:template match=”/book”>
<html><body>
<b>Title: </b> <xsl:value-of select=”title” />
<p/>
<b>By: </b> <xsl:value-of select=”author” />
<p/>
<b>Cost: </b> <xsl:value-of select=”price” />
<p/>
<b>Category: </b> <xsl:value-of select=”category” />
<p/>
<b>Description</b>
<p/>
<i><xsl:value-of select=”summary” /></i>
</body></html>
</xsl:template>
</xsl:stylesheet>

More Related Content

What's hot (20)

PPTX
Xml dom
sana mateen
 
PPTX
Dom parser
sana mateen
 
PPT
Xml
Sudharsan S
 
PPTX
Xml processors
Saurav Mawandia
 
DOC
Xslt
prathap kumar
 
PPTX
Xslt tutorial
Bijoy Kureekkal
 
PPT
Xml Lecture Notes
Santhiya Grace
 
PPTX
Introduction to XSLT
Mahmoud Allam
 
PDF
HTML and XML Difference FAQs
Umar Ali
 
PPT
Understanding XML DOM
Om Vikram Thapa
 
PPT
Introduction of xml and xslt
TUSHAR VARSHNEY
 
PPTX
XSLT
Surinder Kaur
 
PPTX
Introductionto xslt
Kumar
 
PPT
XML/XSLT
thinkahead.net
 
PPT
XML Databases
Jussi Pohjolainen
 
PPTX
Introduction to XML
Kumar
 
Xml dom
sana mateen
 
Dom parser
sana mateen
 
Xml processors
Saurav Mawandia
 
Xslt tutorial
Bijoy Kureekkal
 
Xml Lecture Notes
Santhiya Grace
 
Introduction to XSLT
Mahmoud Allam
 
HTML and XML Difference FAQs
Umar Ali
 
Understanding XML DOM
Om Vikram Thapa
 
Introduction of xml and xslt
TUSHAR VARSHNEY
 
Introductionto xslt
Kumar
 
XML/XSLT
thinkahead.net
 
XML Databases
Jussi Pohjolainen
 
Introduction to XML
Kumar
 

Similar to XSL - XML STYLE SHEET (20)

PPTX
XSLT - Extensible StyleSheet Language Transformations.pptx
abhishekoza1981
 
PPTX
XML Technologies
hamsa nandhini
 
PPT
Learning XSLT
Overdue Books LLC
 
PPTX
Xml part5
NOHA AW
 
PPTX
XSLT presentation
Miguel Angel Teheran Garcia
 
PPT
Xslt
Manav Prasad
 
PPTX
transforming xml using xsl and xslt
Hemant Suthar
 
DOC
Xslt
xavier john
 
PDF
Extensible Stylesheet Language
Jussi Pohjolainen
 
PPTX
Xml data transformation
Raghu nath
 
PPT
XSLT.ppt
KGSCSEPSGCT
 
PPT
Session 4
Lại Đức Chung
 
PDF
Xsl xslt
Dr.Saranya K.G
 
PDF
XSL- XSLT.pdf
KGSCSEPSGCT
 
PPT
5 xsl (formatting xml documents)
gauravashq
 
PPTX
XML XSLT
Vijay Kumar Verma
 
PDF
"Getting Started with XSLT" presentation slides
Russell Ward
 
PPT
Extensible Stylesheet Language
Jussi Pohjolainen
 
PPT
C:\fakepath\xsl final
shivpriya
 
XSLT - Extensible StyleSheet Language Transformations.pptx
abhishekoza1981
 
XML Technologies
hamsa nandhini
 
Learning XSLT
Overdue Books LLC
 
Xml part5
NOHA AW
 
XSLT presentation
Miguel Angel Teheran Garcia
 
transforming xml using xsl and xslt
Hemant Suthar
 
Extensible Stylesheet Language
Jussi Pohjolainen
 
Xml data transformation
Raghu nath
 
XSLT.ppt
KGSCSEPSGCT
 
Xsl xslt
Dr.Saranya K.G
 
XSL- XSLT.pdf
KGSCSEPSGCT
 
5 xsl (formatting xml documents)
gauravashq
 
"Getting Started with XSLT" presentation slides
Russell Ward
 
Extensible Stylesheet Language
Jussi Pohjolainen
 
C:\fakepath\xsl final
shivpriya
 
Ad

More from SaraswathiRamalingam (20)

PPTX
MACINTOSH
SaraswathiRamalingam
 
PPTX
XML SCHEMAS
SaraswathiRamalingam
 
PPTX
XML DTD DOCUMENT TYPE DEFINITION
SaraswathiRamalingam
 
PPTX
Georg scheutz - Charles babbage - Saraswathi Ramalingam
SaraswathiRamalingam
 
PPTX
Dennis ritchie - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PPTX
Arithmetic expression INFIX TO POSTFIX CONVERTION saraswathi ramalingam
SaraswathiRamalingam
 
PPTX
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PPTX
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PPTX
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PPTX
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PPTX
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PPTX
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PPTX
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PPTX
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PPTX
LAB PROGRAMS SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PPTX
C PROGRAMS - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PPTX
SIMPLE C PROGRAMS - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PPTX
Mobile Computing - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
XML DTD DOCUMENT TYPE DEFINITION
SaraswathiRamalingam
 
Georg scheutz - Charles babbage - Saraswathi Ramalingam
SaraswathiRamalingam
 
Dennis ritchie - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
Arithmetic expression INFIX TO POSTFIX CONVERTION saraswathi ramalingam
SaraswathiRamalingam
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
LAB PROGRAMS SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
C PROGRAMS - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
SIMPLE C PROGRAMS - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
Mobile Computing - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
Ad

Recently uploaded (20)

PPTX
Quarter1-English3-W4-Identifying Elements of the Story
FLORRACHELSANTOS
 
PPTX
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PPTX
grade 5 lesson ENGLISH 5_Q1_PPT_WEEK3.pptx
SireQuinn
 
PPTX
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PDF
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PPTX
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PPTX
Mathematics 5 - Time Measurement: Time Zone
menchreo
 
PPTX
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PPTX
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
Quarter1-English3-W4-Identifying Elements of the Story
FLORRACHELSANTOS
 
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
grade 5 lesson ENGLISH 5_Q1_PPT_WEEK3.pptx
SireQuinn
 
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
Mathematics 5 - Time Measurement: Time Zone
menchreo
 
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 

XSL - XML STYLE SHEET

  • 1. XSL XML STYLE SHEET LANGUAGE SARASWATHI RAMALINGAM SRI AKILANDESWARI WOMENS COLLEGE
  • 2. XSL • XSL has two independent languages: – The XSL Transformation Language (XSLT) – The XSL Formatting Object Language (XSL-FO) • XSLT is used to convert an XML document to another format. • XSL-FO provides a way of describing the presentation of an XML document.
  • 3. book.xml <?xml version=”1.0”?> <book> <author>Michael Daconta et al</author> <title>XML Development with Java 2</title> <category>Java</category> <price currency=”USD”>44.99</price> <summary> XML Development with Java 2 provides the information and techniques a Java developer will need to integrate XML into Java-based applications. </summary> </book>
  • 4. book.xml • In this example, we will apply the style sheet in a client-side Web browser. • The XML document makes a reference to a style sheet using the following code: <?xml-stylesheet type=”text/xsl” href=”book_view.xsl”?>
  • 5. Creating the XSL Style Sheet <?xml version=”1.0”?> <xsl:stylesheet xmlns:xsl=”URI” version=”1.0”> <!--XSL-T CONVERSION RULES--> </xsl:stylesheet>
  • 6. • The <xsl:stylesheet> element defines how the XSLT processor should process the current XSL document. • The xmlns attribute is the namespace definition. • The XSL Transformation engine reads the xmlns attribute and determines whether it supports the given namespace.
  • 7. • The xmlns attribute specifies the XSL prefix. • All XSL elements and types in the document use the prefix. • The xmlns attribute value contains a Uniform Resource Identifier (URI), which serves as a generic method for identifying entities on the World Wide Web. • It is important to note that the XSLT processor will not connect to the URI; it simply compares the URI against a collection of URIs that it supports.
  • 8. • The XSL style sheet contains HTML text and XSL elements. • The HTML text forms the basis of the desired output page. • The XSL elements are template rules for the XSLT processor. • A template is associated with a given element in the XML document.
  • 9. • In our example, a template is defined to match on the <book> element using the following code: <xsl:template match=”/book”> <!--static text and xsl rules --> </xsl:template>
  • 10. • XSLT defines the <xsl:value-of> element for retrieving data from a XML document. • The <xsl:value-of> element contains a select attribute. • This attribute value is the name of the actual XML element you want to retrieve. For example <xsl:value-of select=”title” />
  • 11. book_view.xsl <?xml version=”1.0”?> <xsl:stylesheet xmlns:xsl=”http://www.w3.org/1999/XSL/Transform” version=”1.0”> <xsl:template match=”/book”> <html><body> <b>Title: </b> <xsl:value-of select=”title” /> <p/> <b>By: </b> <xsl:value-of select=”author” /> <p/> <b>Cost: </b> <xsl:value-of select=”price” /> <p/> <b>Category: </b> <xsl:value-of select=”category” /> <p/> <b>Description</b> <p/> <i><xsl:value-of select=”summary” /></i> </body></html> </xsl:template> </xsl:stylesheet>