SlideShare a Scribd company logo
Q5M1 - XML Dudy Fathan Ali S.Kom
Rendering XML Document
Q5M1 - XML
Dudy Fathan Ali, S.Kom (DFA)
2015
CEP - CCIT
Fakultas Teknik Universitas Indonesia
Objectives
Q5M1 - XML Dudy Fathan Ali S.Kom
In this session, you will learn to:
Transform an XML document through a Cascading Style Sheet
Transform an XML document through Extensible Style Sheet
Language
Introducing Cascading Style Sheet
Q5M1 - XML Dudy Fathan Ali S.Kom
A CSS is a text file containing one or more rules or definitions for
the style characteristics of a particular element.
It controls how tags are formatted in XML and HTML documents.
The CSS file can be included in XML documents with the same
data structure.
Creating CSS
Q5M1 - XML Dudy Fathan Ali S.Kom
The syntax for coding a CSS is:
elementname {
property1: value;
property2: value;
}
elementname specifies
the name of the element.
Creating CSS
Q5M1 - XML Dudy Fathan Ali S.Kom
The syntax for coding a CSS is:
elementname {
property1: value;
property2: value;
}
property1 and property2
specify the property names, such
as font-family, font-size, and color
Creating CSS
Q5M1 - XML Dudy Fathan Ali S.Kom
The syntax for coding a CSS is:
elementname {
property1: value;
property2: value;
}
value specifies the property
values for a property name.
For example, to display the film title in red, you can type
the following code in a CSS file:
FILM {COLOR: RED}
Applying CSS
Q5M1 - XML Dudy Fathan Ali S.Kom
A CSS can be applied to an XML document using the following
syntax:
<?xml:stylesheet type="text/css" href="path-name"?>
Instructs the browser that the XML
document uses a stylesheet.
Applying CSS
Q5M1 - XML Dudy Fathan Ali S.Kom
A CSS can be applied to an XML document using the following
syntax:
<?xml:stylesheet type="text/css" href="path-name"?>
Specifies the type of
formatting that is being used.
Applying CSS
Q5M1 - XML Dudy Fathan Ali S.Kom
A CSS can be applied to an XML document using the following
syntax:
<?xml:stylesheet type="text/css" href="path-name"?>
Specifies the name of the CSS
file used to format the XML
document.
Demo: Creating a CSS
Q5M1 - XML Dudy Fathan Ali S.Kom
Problem Statement:
Jim, the XML developer at CyberShoppe, has been asked to display
the product details for Cybershoppe in a browser in the following
format:
The price per unit, description, and quantity on hand for each product
should be displayed in teal, with a font size of 10 pts.
The product name should be displayed in red, with a font size of 20 pts.
It should be displayed in bold.
All details should be displayed in the Arial font.
Introducing XSL
Q5M1 - XML Dudy Fathan Ali S.Kom
CSS does not support the reorder, sort, and display of
elements based on a condition.
For such advanced formatting, XML supports Extensible Style
Sheet Language (XSL).
XSL has two parts:
XSL Transformations (XSLT)
XML Path (XPath)
XSL:
Contains instructions on how an XML document should be
transformed into an HTML or an XHTML document.
Uses XPath expressions to extract specific data from an XML
document.
The XSLT processor transforms the XML document into an
HTML or XHTML or into another XML document.
Analyzing the Working of the XSLT Processor
Q5M1 - XML Dudy Fathan Ali S.Kom
The XSLT processor applies the transformation information to
the source document and builds the result tree as shown in the
following figure.
MSXML Parser
XSLT tree
XSLT
processor
Source tree
Result tree
XSLT style sheet
XML document
Formatting Data Using XSLT
Q5M1 - XML Dudy Fathan Ali S.Kom
XSLT provides the following elements to select and format
data:
stylesheet
value-of
for-each
sort
text
Formatting Data Using XSLT
Q5M1 - XML Dudy Fathan Ali S.Kom
XSLT provides the following elements to select and format
data:
stylesheet
value-of
for-each
sort
text
Instructs the browser that the document is a style
sheet file.
Is the root element for all XSLT style sheets.
Is written as:
<xsl:stylesheet
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
version="1.0">
Formatting Data Using XSLT
Q5M1 - XML Dudy Fathan Ali S.Kom
XSLT provides the following elements to select and format
data:
stylesheet
value-of
for-each
sort
text
Displays the value of the specified element or
attribute.
Follows the syntax:
<xsl:value-of
select="elementname/attributename“
/>
Formatting Data Using XSLT
Q5M1 - XML Dudy Fathan Ali S.Kom
XSLT provides the following elements to select and format
data:
stylesheet
value-of
for-each
sort
text
Instructs the XSLT processor to process the
information for each instance of the specified pattern.
Follows the syntax:
<xsl:for-each select="pattern">
[action to be performed]
</xsl:for-each>
Formatting Data Using XSLT
Q5M1 - XML Dudy Fathan Ali S.Kom
XSLT provides the following elements to select and format
data:
stylesheet
value-of
for-each
sort
text
Sorts data based on the values assigned to elements and
attributes.
Follows the syntax:
<xsl:sort select="expression"
order="ascending | descending"
case-order="upper-first | lower-first“
data-type="text | number | qname"/>
Formatting Data Using XSLT
Q5M1 - XML Dudy Fathan Ali S.Kom
XSLT provides the following elements to select and format
data:
stylesheet
value-of
for-each
sort
text Generates constant text in the output and displays
labels.
Follows the syntax:
<xsl:text>
Text to be displayed as label
</xsl:text>
Creating XSLT Template Rules
Q5M1 - XML Dudy Fathan Ali S.Kom
A template rule:
Describes how an XML element and its contents are converted into
a specific format for displaying in the browser.
Consists of two parts:
A pattern that identifies an XML element in an XML document.
An action or processing code that details the transformation and
rendering of the resulting element.
XSLT uses two main elements for creating template rules:
template
apply-templates
Creating XSLT Template Rules
Q5M1 - XML Dudy Fathan Ali S.Kom
A template rule:
Describes how an XML element and its contents are converted into
a specific format for displaying in the browser.
Consists of two parts:
A pattern that identifies an XML element in an XML document.
An action or processing code that details the transformation and
rendering of the resulting element.
XSLT uses two main elements for creating template rules:
template
apply-templates
Defines a template for the desired
output.
Follows the syntax:
<xsl:template match="pattern">
[action to be taken]
</xsl:template>
Creating XSLT Template Rules
Q5M1 - XML Dudy Fathan Ali S.Kom
A template rule:
Describes how an XML element and its contents are converted into
a specific format for displaying in the browser.
Consists of two parts:
A pattern that identifies an XML element in an XML document.
An action or processing code that details the transformation and
rendering of the resulting element.
XSLT uses two main elements for creating template rules:
template
apply-templates Instructs the XSLT processor to find an
appropriate template and perform the
specified tasks on selected elements.
Follows the syntax:
<xsl:apply-templates
[select="pattern"]>
Demo: Creating an XSLT Style Sheet to Format Data
Q5M1 - XML Dudy Fathan Ali S.Kom
Problem Statement:
CyberShoppe needs to display product details, such as product ID,
name, and price per unit. The following figure depicts a sample
output.
The details about the products should be displayed in red.
Q5M1 - XML Dudy Fathan Ali S.Kom
Thank You!
Dudy Fathan Ali S.Kom
dudy.fathan@eng.ui.ac.id

More Related Content

What's hot (19)

PPT
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xml
Ông Thông
 
ODP
XML
Osama Qunoo
 
PPT
03 namespace
Baskarkncet
 
PPTX
Xml basics
Kumar
 
PPTX
Basics of XML
indiangarg
 
PPT
00 introduction
Baskarkncet
 
PPT
Introduction to XML
Fazli Kabashi
 
PDF
XML
Prabu U
 
PPT
XML Presentation-2
Sudharsan S
 
PPTX
Xml presentation
Miguel Angel Teheran Garcia
 
PPTX
transforming xml using xsl and xslt
Hemant Suthar
 
PPTX
Xml schema
Akshaya Akshaya
 
PPT
02 well formed and valid documents
Baskarkncet
 
PPT
Xml Presentation-3
Sudharsan S
 
PPT
Xml Presentation-1
Sudharsan S
 
PPT
Xml schema
Harry Potter
 
PPTX
XML
Ruchika Sinha
 
PDF
Introduction to XML and Databases
torp42
 
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xml
Ông Thông
 
03 namespace
Baskarkncet
 
Xml basics
Kumar
 
Basics of XML
indiangarg
 
00 introduction
Baskarkncet
 
Introduction to XML
Fazli Kabashi
 
XML
Prabu U
 
XML Presentation-2
Sudharsan S
 
Xml presentation
Miguel Angel Teheran Garcia
 
transforming xml using xsl and xslt
Hemant Suthar
 
Xml schema
Akshaya Akshaya
 
02 well formed and valid documents
Baskarkncet
 
Xml Presentation-3
Sudharsan S
 
Xml Presentation-1
Sudharsan S
 
Xml schema
Harry Potter
 
Introduction to XML and Databases
torp42
 

Viewers also liked (20)

PPTX
To try use XSL for display group XML file movies
Aey Unthika
 
PDF
Building Collaborative Applications with Wikis
Meredith Farkas
 
ODP
Documenting code yapceu2016
Søren Lund
 
PPT
Wikis 2008
David Liziard
 
PDF
MSc dissertation np
Mohamed Shaheedullah
 
PPTX
code documentation
MADUABUM NNANNA
 
PDF
Chapter 04 part 2 Tech. Writing 2014-2015
Magdi Saadawi
 
ODP
E-books and App::Pod2Epub
Søren Lund
 
PDF
Project Documentation | Common Room Networks Foundation | 2003 - 2008
Gustaff Harriman Iskandar
 
PPTX
How developers write documentation
Senthilkumar Gopal
 
PDF
Chapter 04 2014-15 Technical Writing
Magdi Saadawi
 
PPT
Wonderful World of Wikis
Vicki Davis
 
PPTX
Code documentation
Adégòkè Obasá
 
PPT
Doxygen - Source Code Documentation Generator Tool
Guo Albert
 
PDF
XSLT. Basic.
Alexander Kirillov
 
PPTX
Thinking of Documentation as Code [YUIConf 2013]
evangoer
 
PDF
Introducción a la gestión de sistemas de información en la empresa. Universit...
Julio Iglesias Pascual
 
PPT
Docs as-code-missing.-manual
Margaret Eker
 
PPT
Session 4
Lại Đức Chung
 
PDF
XSLT 2010-03-03
kmiyako
 
To try use XSL for display group XML file movies
Aey Unthika
 
Building Collaborative Applications with Wikis
Meredith Farkas
 
Documenting code yapceu2016
Søren Lund
 
Wikis 2008
David Liziard
 
MSc dissertation np
Mohamed Shaheedullah
 
code documentation
MADUABUM NNANNA
 
Chapter 04 part 2 Tech. Writing 2014-2015
Magdi Saadawi
 
E-books and App::Pod2Epub
Søren Lund
 
Project Documentation | Common Room Networks Foundation | 2003 - 2008
Gustaff Harriman Iskandar
 
How developers write documentation
Senthilkumar Gopal
 
Chapter 04 2014-15 Technical Writing
Magdi Saadawi
 
Wonderful World of Wikis
Vicki Davis
 
Code documentation
Adégòkè Obasá
 
Doxygen - Source Code Documentation Generator Tool
Guo Albert
 
XSLT. Basic.
Alexander Kirillov
 
Thinking of Documentation as Code [YUIConf 2013]
evangoer
 
Introducción a la gestión de sistemas de información en la empresa. Universit...
Julio Iglesias Pascual
 
Docs as-code-missing.-manual
Margaret Eker
 
XSLT 2010-03-03
kmiyako
 
Ad

Similar to Rendering XML Document (20)

PPT
Rendering XML Documents
yht4ever
 
PPT
Rendering XML Document
yht4ever
 
PPT
Xml Session No 1
Saif Ullah Dar
 
PPS
03 sm3 xml_xp_05
Niit Care
 
PPT
Xml and DTD's
Swati Parmar
 
PPT
5 xsl (formatting xml documents)
gauravashq
 
PPTX
Xslt
Mahara Jothi
 
PPTX
Xml part5
NOHA AW
 
PPTX
Xml transformation language
reshmavasudev
 
PDF
"Getting Started with XSLT" presentation slides
Russell Ward
 
DOCX
Introduction to xml schema
Abhishek Kesharwani
 
DOC
Xslt
prathap kumar
 
DOC
Xslt
xavier john
 
PPTX
Unit2_XML_S_SS_US Data_CS19414.pptx
NEHARAJPUT239591
 
PPTX
Xml PPT
Jasbeer Chauhan
 
PPTX
Unit 5 xml (1)
manochitra10
 
PPT
XML/XSLT
thinkahead.net
 
PDF
Rancangan Jaringan Komputer
Candra Adi Putra
 
DOC
Xsd
xavier john
 
Rendering XML Documents
yht4ever
 
Rendering XML Document
yht4ever
 
Xml Session No 1
Saif Ullah Dar
 
03 sm3 xml_xp_05
Niit Care
 
Xml and DTD's
Swati Parmar
 
5 xsl (formatting xml documents)
gauravashq
 
Xml part5
NOHA AW
 
Xml transformation language
reshmavasudev
 
"Getting Started with XSLT" presentation slides
Russell Ward
 
Introduction to xml schema
Abhishek Kesharwani
 
Unit2_XML_S_SS_US Data_CS19414.pptx
NEHARAJPUT239591
 
Unit 5 xml (1)
manochitra10
 
XML/XSLT
thinkahead.net
 
Rancangan Jaringan Komputer
Candra Adi Putra
 
Ad

More from Dudy Ali (20)

PDF
Understanding COM+
Dudy Ali
 
PDF
Distributed Application Development (Introduction)
Dudy Ali
 
PPTX
Java CRUD Mechanism with SQL Server Database
Dudy Ali
 
PPTX
Network Socket Programming with JAVA
Dudy Ali
 
PPTX
Review Materi ASP.NET
Dudy Ali
 
PPTX
Pengantar XML
Dudy Ali
 
PPTX
Pengantar XML DOM
Dudy Ali
 
PPTX
Pengantar ADO.NET
Dudy Ali
 
PPTX
Database Connectivity with JDBC
Dudy Ali
 
PPTX
Algorithm & Data Structure - Algoritma Pengurutan
Dudy Ali
 
PPTX
Algorithm & Data Structure - Pengantar
Dudy Ali
 
PPTX
Object Oriented Programming - Value Types & Reference Types
Dudy Ali
 
PPTX
Object Oriented Programming - Inheritance
Dudy Ali
 
PPTX
Object Oriented Programming - File Input & Output
Dudy Ali
 
PPTX
Object Oriented Programming - Constructors & Destructors
Dudy Ali
 
PPTX
Object Oriented Programming - Abstraction & Encapsulation
Dudy Ali
 
PPTX
Web Programming Syaria - Pengenalan Halaman Web
Dudy Ali
 
PPTX
Web Programming Syaria - PHP
Dudy Ali
 
PPTX
Software Project Management - Project Management Knowledge
Dudy Ali
 
PPTX
Software Project Management - Proses Manajemen Proyek
Dudy Ali
 
Understanding COM+
Dudy Ali
 
Distributed Application Development (Introduction)
Dudy Ali
 
Java CRUD Mechanism with SQL Server Database
Dudy Ali
 
Network Socket Programming with JAVA
Dudy Ali
 
Review Materi ASP.NET
Dudy Ali
 
Pengantar XML
Dudy Ali
 
Pengantar XML DOM
Dudy Ali
 
Pengantar ADO.NET
Dudy Ali
 
Database Connectivity with JDBC
Dudy Ali
 
Algorithm & Data Structure - Algoritma Pengurutan
Dudy Ali
 
Algorithm & Data Structure - Pengantar
Dudy Ali
 
Object Oriented Programming - Value Types & Reference Types
Dudy Ali
 
Object Oriented Programming - Inheritance
Dudy Ali
 
Object Oriented Programming - File Input & Output
Dudy Ali
 
Object Oriented Programming - Constructors & Destructors
Dudy Ali
 
Object Oriented Programming - Abstraction & Encapsulation
Dudy Ali
 
Web Programming Syaria - Pengenalan Halaman Web
Dudy Ali
 
Web Programming Syaria - PHP
Dudy Ali
 
Software Project Management - Project Management Knowledge
Dudy Ali
 
Software Project Management - Proses Manajemen Proyek
Dudy Ali
 

Recently uploaded (20)

PDF
July Patch Tuesday
Ivanti
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
July Patch Tuesday
Ivanti
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 

Rendering XML Document

  • 1. Q5M1 - XML Dudy Fathan Ali S.Kom Rendering XML Document Q5M1 - XML Dudy Fathan Ali, S.Kom (DFA) 2015 CEP - CCIT Fakultas Teknik Universitas Indonesia
  • 2. Objectives Q5M1 - XML Dudy Fathan Ali S.Kom In this session, you will learn to: Transform an XML document through a Cascading Style Sheet Transform an XML document through Extensible Style Sheet Language
  • 3. Introducing Cascading Style Sheet Q5M1 - XML Dudy Fathan Ali S.Kom A CSS is a text file containing one or more rules or definitions for the style characteristics of a particular element. It controls how tags are formatted in XML and HTML documents. The CSS file can be included in XML documents with the same data structure.
  • 4. Creating CSS Q5M1 - XML Dudy Fathan Ali S.Kom The syntax for coding a CSS is: elementname { property1: value; property2: value; } elementname specifies the name of the element.
  • 5. Creating CSS Q5M1 - XML Dudy Fathan Ali S.Kom The syntax for coding a CSS is: elementname { property1: value; property2: value; } property1 and property2 specify the property names, such as font-family, font-size, and color
  • 6. Creating CSS Q5M1 - XML Dudy Fathan Ali S.Kom The syntax for coding a CSS is: elementname { property1: value; property2: value; } value specifies the property values for a property name. For example, to display the film title in red, you can type the following code in a CSS file: FILM {COLOR: RED}
  • 7. Applying CSS Q5M1 - XML Dudy Fathan Ali S.Kom A CSS can be applied to an XML document using the following syntax: <?xml:stylesheet type="text/css" href="path-name"?> Instructs the browser that the XML document uses a stylesheet.
  • 8. Applying CSS Q5M1 - XML Dudy Fathan Ali S.Kom A CSS can be applied to an XML document using the following syntax: <?xml:stylesheet type="text/css" href="path-name"?> Specifies the type of formatting that is being used.
  • 9. Applying CSS Q5M1 - XML Dudy Fathan Ali S.Kom A CSS can be applied to an XML document using the following syntax: <?xml:stylesheet type="text/css" href="path-name"?> Specifies the name of the CSS file used to format the XML document.
  • 10. Demo: Creating a CSS Q5M1 - XML Dudy Fathan Ali S.Kom Problem Statement: Jim, the XML developer at CyberShoppe, has been asked to display the product details for Cybershoppe in a browser in the following format: The price per unit, description, and quantity on hand for each product should be displayed in teal, with a font size of 10 pts. The product name should be displayed in red, with a font size of 20 pts. It should be displayed in bold. All details should be displayed in the Arial font.
  • 11. Introducing XSL Q5M1 - XML Dudy Fathan Ali S.Kom CSS does not support the reorder, sort, and display of elements based on a condition. For such advanced formatting, XML supports Extensible Style Sheet Language (XSL). XSL has two parts: XSL Transformations (XSLT) XML Path (XPath) XSL: Contains instructions on how an XML document should be transformed into an HTML or an XHTML document. Uses XPath expressions to extract specific data from an XML document. The XSLT processor transforms the XML document into an HTML or XHTML or into another XML document.
  • 12. Analyzing the Working of the XSLT Processor Q5M1 - XML Dudy Fathan Ali S.Kom The XSLT processor applies the transformation information to the source document and builds the result tree as shown in the following figure. MSXML Parser XSLT tree XSLT processor Source tree Result tree XSLT style sheet XML document
  • 13. Formatting Data Using XSLT Q5M1 - XML Dudy Fathan Ali S.Kom XSLT provides the following elements to select and format data: stylesheet value-of for-each sort text
  • 14. Formatting Data Using XSLT Q5M1 - XML Dudy Fathan Ali S.Kom XSLT provides the following elements to select and format data: stylesheet value-of for-each sort text Instructs the browser that the document is a style sheet file. Is the root element for all XSLT style sheets. Is written as: <xsl:stylesheet xmlns:xsl= "http://www.w3.org/1999/XSL/Transform" version="1.0">
  • 15. Formatting Data Using XSLT Q5M1 - XML Dudy Fathan Ali S.Kom XSLT provides the following elements to select and format data: stylesheet value-of for-each sort text Displays the value of the specified element or attribute. Follows the syntax: <xsl:value-of select="elementname/attributename“ />
  • 16. Formatting Data Using XSLT Q5M1 - XML Dudy Fathan Ali S.Kom XSLT provides the following elements to select and format data: stylesheet value-of for-each sort text Instructs the XSLT processor to process the information for each instance of the specified pattern. Follows the syntax: <xsl:for-each select="pattern"> [action to be performed] </xsl:for-each>
  • 17. Formatting Data Using XSLT Q5M1 - XML Dudy Fathan Ali S.Kom XSLT provides the following elements to select and format data: stylesheet value-of for-each sort text Sorts data based on the values assigned to elements and attributes. Follows the syntax: <xsl:sort select="expression" order="ascending | descending" case-order="upper-first | lower-first“ data-type="text | number | qname"/>
  • 18. Formatting Data Using XSLT Q5M1 - XML Dudy Fathan Ali S.Kom XSLT provides the following elements to select and format data: stylesheet value-of for-each sort text Generates constant text in the output and displays labels. Follows the syntax: <xsl:text> Text to be displayed as label </xsl:text>
  • 19. Creating XSLT Template Rules Q5M1 - XML Dudy Fathan Ali S.Kom A template rule: Describes how an XML element and its contents are converted into a specific format for displaying in the browser. Consists of two parts: A pattern that identifies an XML element in an XML document. An action or processing code that details the transformation and rendering of the resulting element. XSLT uses two main elements for creating template rules: template apply-templates
  • 20. Creating XSLT Template Rules Q5M1 - XML Dudy Fathan Ali S.Kom A template rule: Describes how an XML element and its contents are converted into a specific format for displaying in the browser. Consists of two parts: A pattern that identifies an XML element in an XML document. An action or processing code that details the transformation and rendering of the resulting element. XSLT uses two main elements for creating template rules: template apply-templates Defines a template for the desired output. Follows the syntax: <xsl:template match="pattern"> [action to be taken] </xsl:template>
  • 21. Creating XSLT Template Rules Q5M1 - XML Dudy Fathan Ali S.Kom A template rule: Describes how an XML element and its contents are converted into a specific format for displaying in the browser. Consists of two parts: A pattern that identifies an XML element in an XML document. An action or processing code that details the transformation and rendering of the resulting element. XSLT uses two main elements for creating template rules: template apply-templates Instructs the XSLT processor to find an appropriate template and perform the specified tasks on selected elements. Follows the syntax: <xsl:apply-templates [select="pattern"]>
  • 22. Demo: Creating an XSLT Style Sheet to Format Data Q5M1 - XML Dudy Fathan Ali S.Kom Problem Statement: CyberShoppe needs to display product details, such as product ID, name, and price per unit. The following figure depicts a sample output. The details about the products should be displayed in red.
  • 23. Q5M1 - XML Dudy Fathan Ali S.Kom Thank You! Dudy Fathan Ali S.Kom [email protected]