SlideShare a Scribd company logo
XML DATA
TRANSFORMATION
• XML was first introduced as a metalanguage for data
description.
• A metalanguage represents a well-defined interface that
evolves and is transformed into derived languages. XML is
simply the foundation interface for a number of specific
markup languages, each of which is based on its own
vocabulary and schema.
• The schema syntactically differentiates XML languages from
each other. XML is key for data exchange and interoperability,
and the schema is essential for providing XML documents with
a typed and well-defined structure. Unfortunately, in the
imperfect world in which we live, schemas often express the
same semantics through different syntaxes.
• An XML transformation is simply the XML workaround for this
relatively common
situation. An XML transformation is a user-defined algorithm that
attempts to express
the semantics of a given document using another equivalent syntax. A
transformation is much like a type cast in programming. You can
always try to coerce the type, but in
doing so you could face and accept compromises like syntax
adaptations and,
sometimes, loss of data and logic.
• In XML, the transformation process is seen as the application of a
style sheet to the
source document. The style sheet is a declarative and user-defined
document that is
referred to as extensible. The term Extensible Stylesheet Language
(XSL) indicates a
metalanguage designed for expressing style sheets for XML
documents. An XSL file
contains the set of rules that will be used to transform a document into
another,
• XSL files were originally conceived as the XML counterpart of HTML's
cascading style
sheets (CSS). In this context, XSL files were simply extensible and user-
definable tools
to render an XML markup in HTML for display purposes. The growing
complexity of
style sheets, as well as the advent of XML schemas, changed the
perspective of XSL
and led to XSL Transformations (XSLT).
• The goal of XSL has evolved over time. Today, XSL is a blanket
term for a number of derived technologies that altogether
better qualify and implement the original idea of styling XML
documents. The various components that fall under the
umbrella of XSL are the actual software entities that you use in
your code:
• XSLT Rule-based language for transforming XML documents
into any other
text-based format. XSLT provides for XML-to-XML
transformation, which
mostly means schema transformation. An XSLT program is a
generic set of
transformation rules whose output can be any text-based
language,
including HTML, Rich Text Format (RTF), and Wireless Markup
• XPath Query language that XSLT programs use to select specific
parts of an
XML document. The result of XPath expressions is then parsed
and
elaborated by the XSLT processor
• XSL Formatting Objects (XSL-FO) Advanced styling features
expressed by
• an XML vocabulary that define the semantics of a set of
formatting
• elements
XSLT TEMPLATE PROGRAMMING
XSLT is a process that combines two XML documents—the XML source
file and the style sheet—to produce a third document. The resultant
document can be an XML document, an HTML page, or any text-based
file the style sheet has been instructed to generate.
The source document must meet only one requirement: it must be a
well-formed XML
document. The style sheet must be a valid XML document that contains
the transformation logic expressed using the elements in the XSLT
vocabulary. An XSLT
style sheet can be seen as a sequence of templates.
AN OVERVIEW OF THE XSLT PROCESS
• The core part of the transformation process is the application
of templates to XML source elements. Other ancillary steps
might include the expansion of elements to text, the execution
of some script code, and the selection of a subset of nodes
using Xpath queries. The layout of a generic XSLT script is
shown here:
• <xsl:stylesheet
• xmlns:xsl="http://www.w3.org/1999/xsl/transform">
• <xsl:template match="/">
• ⋮
• </xsl:template>
• <xsl:template match="...">
• ⋮
• </xsl:template>
• ⋮
• </xsl:stylesheet>
• The final output of each template must form a syntactically valid fragment in
the target
• language—be it XML, HTML, RTF, or some other language. You are not
required to
• indicate the target language explicitly, although the XSLT vocabulary
provides a tailormade
• instruction to declare what the expected output will be. The main
requirement for
• the XSLT style sheet is that its overall text be well-formed XML. In addition,
it must
• make syntactically correct use of all the XSLT instructions it needs. The
APPLYING AN XSLT TEMPLATE TO SOURCE
MARKUP TEXT.
XSLT INSTRUCTIONS
• The XSLT vocabulary consists of special tags that represent particular
operations you
• can perform on the source markup text or passed arguments.
Although the overall
• syntax is that of a rigorous XML dialect, you can easily recognize the
main constructs of a high-level programming language.
• The following subsections summarize the main XSLT instructions you
are likely to run
• across in your XSLT experience. The XSLT instructions are divided
into four categories:
Xml data transformation
THE STYLE SHEET IS FIRST NORMALIZED TO
AN XPATH NAVIGATOR AND THEN
COMPILED
MANAGING THE PROCESSOR'S STATE
• The style sheet compiler populates three internal data
structures with the data read from the source.
PERFORMING TRANSFORMATIONS
FURTHER READING:
• http://www.w3.org/TR/xslt
Ad

More Related Content

What's hot (20)

XML
XMLXML
XML
Mukesh Tekwani
 
Xml
XmlXml
Xml
Dr. C.V. Suresh Babu
 
XML
XMLXML
XML
Mukesh Tekwani
 
10. XML in DBMS
10. XML in DBMS10. XML in DBMS
10. XML in DBMS
koolkampus
 
Xml
XmlXml
Xml
Venkat Krishnan
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
Jussi Pohjolainen
 
Introduction to XML and Databases
Introduction to XML and DatabasesIntroduction to XML and Databases
Introduction to XML and Databases
torp42
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
Fazli Kabashi
 
XML
XMLXML
XML
Osama Qunoo
 
Xml
XmlXml
Xml
Santosh Pandey
 
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xml
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xmlXml theory 2005_[ngohaianh.info]_1_introduction-to-xml
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xml
Ông Thông
 
Xml 215-presentation
Xml 215-presentationXml 215-presentation
Xml 215-presentation
Manish Chaurasia
 
XML Introduction
XML IntroductionXML Introduction
XML Introduction
Marco Bresciani
 
XML
XMLXML
XML
Daminda Herath
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
BG Java EE Course
 
uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2
Abhishek Kesharwani
 
Extensible Markup Language (XML)
Extensible Markup Language (XML)Extensible Markup Language (XML)
Extensible Markup Language (XML)
AakankshaR
 
Xml ppt
Xml pptXml ppt
Xml ppt
seemadav1
 
Xml applications
Xml applicationsXml applications
Xml applications
Nabahat Tahir
 
Web programming xml
Web programming  xmlWeb programming  xml
Web programming xml
Uma mohan
 

Similar to Xml data transformation (20)

web technology basics in detail about .pptx
web technology basics in detail about .pptxweb technology basics in detail about .pptx
web technology basics in detail about .pptx
ManimaranMagesh
 
E05412327
E05412327E05412327
E05412327
IOSR-JEN
 
eXtensible Markup Language
eXtensible Markup LanguageeXtensible Markup Language
eXtensible Markup Language
Aditya Raj
 
XML/XSLT
XML/XSLTXML/XSLT
XML/XSLT
thinkahead.net
 
Tutor Xml Gxs
Tutor Xml GxsTutor Xml Gxs
Tutor Xml Gxs
nit Allahabad
 
Xml programming language myassignmenthelp.net
Xml programming  language myassignmenthelp.netXml programming  language myassignmenthelp.net
Xml programming language myassignmenthelp.net
www.myassignmenthelp.net
 
Introduction to XSLT
Introduction to XSLTIntroduction to XSLT
Introduction to XSLT
Mahmoud Allam
 
Module 5 XML Notes.pdf
Module 5 XML Notes.pdfModule 5 XML Notes.pdf
Module 5 XML Notes.pdf
ssuser21721b
 
Extensible stylesheet language (Transformation) or XSLT
Extensible stylesheet language (Transformation) or XSLTExtensible stylesheet language (Transformation) or XSLT
Extensible stylesheet language (Transformation) or XSLT
Ashikur Rahman
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
soumya
 
Xml iet 2015
Xml iet 2015Xml iet 2015
Xml iet 2015
kiransurariya
 
Xml
XmlXml
Xml
Kiran Mangrulia
 
Xml unit1
Xml unit1Xml unit1
Xml unit1
sathyasudha
 
XML1.pptx
XML1.pptxXML1.pptx
XML1.pptx
53ShaikhImadoddin
 
XML
XMLXML
XML
eewiley
 
Markup For Dummies (Russ Ward)
Markup For Dummies (Russ Ward)Markup For Dummies (Russ Ward)
Markup For Dummies (Russ Ward)
STC-Philadelphia Metro Chapter
 
XSLT
XSLTXSLT
XSLT
Kamal Acharya
 
Xml
XmlXml
Xml
baabtra.com - No. 1 supplier of quality freshers
 
Applied xml programming for microsoft
Applied xml programming for microsoftApplied xml programming for microsoft
Applied xml programming for microsoft
Raghu nath
 
XML
XMLXML
XML
Kamal Acharya
 
Ad

More from Raghu nath (20)

Mongo db
Mongo dbMongo db
Mongo db
Raghu nath
 
Ftp (file transfer protocol)
Ftp (file transfer protocol)Ftp (file transfer protocol)
Ftp (file transfer protocol)
Raghu nath
 
MS WORD 2013
MS WORD 2013MS WORD 2013
MS WORD 2013
Raghu nath
 
Msword
MswordMsword
Msword
Raghu nath
 
Ms word
Ms wordMs word
Ms word
Raghu nath
 
Javascript part1
Javascript part1Javascript part1
Javascript part1
Raghu nath
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Raghu nath
 
Selection sort
Selection sortSelection sort
Selection sort
Raghu nath
 
Binary search
Binary search Binary search
Binary search
Raghu nath
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)
Raghu nath
 
Stemming algorithms
Stemming algorithmsStemming algorithms
Stemming algorithms
Raghu nath
 
Step by step guide to install dhcp role
Step by step guide to install dhcp roleStep by step guide to install dhcp role
Step by step guide to install dhcp role
Raghu nath
 
Network essentials chapter 4
Network essentials  chapter 4Network essentials  chapter 4
Network essentials chapter 4
Raghu nath
 
Network essentials chapter 3
Network essentials  chapter 3Network essentials  chapter 3
Network essentials chapter 3
Raghu nath
 
Network essentials chapter 2
Network essentials  chapter 2Network essentials  chapter 2
Network essentials chapter 2
Raghu nath
 
Network essentials - chapter 1
Network essentials - chapter 1Network essentials - chapter 1
Network essentials - chapter 1
Raghu nath
 
Python chapter 2
Python chapter 2Python chapter 2
Python chapter 2
Raghu nath
 
python chapter 1
python chapter 1python chapter 1
python chapter 1
Raghu nath
 
Linux Shell Scripting
Linux Shell ScriptingLinux Shell Scripting
Linux Shell Scripting
Raghu nath
 
Perl
PerlPerl
Perl
Raghu nath
 
Ftp (file transfer protocol)
Ftp (file transfer protocol)Ftp (file transfer protocol)
Ftp (file transfer protocol)
Raghu nath
 
Javascript part1
Javascript part1Javascript part1
Javascript part1
Raghu nath
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Raghu nath
 
Selection sort
Selection sortSelection sort
Selection sort
Raghu nath
 
Binary search
Binary search Binary search
Binary search
Raghu nath
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)
Raghu nath
 
Stemming algorithms
Stemming algorithmsStemming algorithms
Stemming algorithms
Raghu nath
 
Step by step guide to install dhcp role
Step by step guide to install dhcp roleStep by step guide to install dhcp role
Step by step guide to install dhcp role
Raghu nath
 
Network essentials chapter 4
Network essentials  chapter 4Network essentials  chapter 4
Network essentials chapter 4
Raghu nath
 
Network essentials chapter 3
Network essentials  chapter 3Network essentials  chapter 3
Network essentials chapter 3
Raghu nath
 
Network essentials chapter 2
Network essentials  chapter 2Network essentials  chapter 2
Network essentials chapter 2
Raghu nath
 
Network essentials - chapter 1
Network essentials - chapter 1Network essentials - chapter 1
Network essentials - chapter 1
Raghu nath
 
Python chapter 2
Python chapter 2Python chapter 2
Python chapter 2
Raghu nath
 
python chapter 1
python chapter 1python chapter 1
python chapter 1
Raghu nath
 
Linux Shell Scripting
Linux Shell ScriptingLinux Shell Scripting
Linux Shell Scripting
Raghu nath
 
Ad

Recently uploaded (20)

MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFAMCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
INDIA QUIZ FOR SCHOOLS | THE QUIZ CLUB OF PSGCAS | AUGUST 2024
INDIA QUIZ FOR SCHOOLS | THE QUIZ CLUB OF PSGCAS | AUGUST 2024INDIA QUIZ FOR SCHOOLS | THE QUIZ CLUB OF PSGCAS | AUGUST 2024
INDIA QUIZ FOR SCHOOLS | THE QUIZ CLUB OF PSGCAS | AUGUST 2024
Quiz Club of PSG College of Arts & Science
 
20250515 Ntegra San Francisco 20250515 v15.pptx
20250515 Ntegra San Francisco 20250515 v15.pptx20250515 Ntegra San Francisco 20250515 v15.pptx
20250515 Ntegra San Francisco 20250515 v15.pptx
home
 
Statement by Linda McMahon on May 21, 2025
Statement by Linda McMahon on May 21, 2025Statement by Linda McMahon on May 21, 2025
Statement by Linda McMahon on May 21, 2025
Mebane Rash
 
A report on the county distress rankings in NC
A report on the county distress rankings in NCA report on the county distress rankings in NC
A report on the county distress rankings in NC
Mebane Rash
 
GENERAL QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 4 MARCH 2025 .pdf
GENERAL QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 4 MARCH 2025 .pdfGENERAL QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 4 MARCH 2025 .pdf
GENERAL QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 4 MARCH 2025 .pdf
Quiz Club of PSG College of Arts & Science
 
How to Manage Cross Selling in Odoo 18 Sales
How to Manage Cross Selling in Odoo 18 SalesHow to Manage Cross Selling in Odoo 18 Sales
How to Manage Cross Selling in Odoo 18 Sales
Celine George
 
libbys peer assesment.docx..............
libbys peer assesment.docx..............libbys peer assesment.docx..............
libbys peer assesment.docx..............
19lburrell
 
UNITED_KINGDOM.pptUNITED_KINGDOM.pptUNITED_KINGDOM.ppt
UNITED_KINGDOM.pptUNITED_KINGDOM.pptUNITED_KINGDOM.pptUNITED_KINGDOM.pptUNITED_KINGDOM.pptUNITED_KINGDOM.ppt
UNITED_KINGDOM.pptUNITED_KINGDOM.pptUNITED_KINGDOM.ppt
lsitinova
 
The Pedagogy We Practice: Best Practices for Critical Instructional Design
The Pedagogy We Practice: Best Practices for Critical Instructional DesignThe Pedagogy We Practice: Best Practices for Critical Instructional Design
The Pedagogy We Practice: Best Practices for Critical Instructional Design
Sean Michael Morris
 
How to Manage Manual Reordering Rule in Odoo 18 Inventory
How to Manage Manual Reordering Rule in Odoo 18 InventoryHow to Manage Manual Reordering Rule in Odoo 18 Inventory
How to Manage Manual Reordering Rule in Odoo 18 Inventory
Celine George
 
The History of Kashmir Lohar Dynasty NEP.ppt
The History of Kashmir Lohar Dynasty NEP.pptThe History of Kashmir Lohar Dynasty NEP.ppt
The History of Kashmir Lohar Dynasty NEP.ppt
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Letter to Secretary Linda McMahon from U.S. Senators
Letter to Secretary Linda McMahon from U.S. SenatorsLetter to Secretary Linda McMahon from U.S. Senators
Letter to Secretary Linda McMahon from U.S. Senators
Mebane Rash
 
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
parmarjuli1412
 
How to Add Button in Chatter in Odoo 18 - Odoo Slides
How to Add Button in Chatter in Odoo 18 - Odoo SlidesHow to Add Button in Chatter in Odoo 18 - Odoo Slides
How to Add Button in Chatter in Odoo 18 - Odoo Slides
Celine George
 
PUBH1000 Slides - Module 12: Advocacy for Health
PUBH1000 Slides - Module 12: Advocacy for HealthPUBH1000 Slides - Module 12: Advocacy for Health
PUBH1000 Slides - Module 12: Advocacy for Health
JonathanHallett4
 
How to Change Sequence Number in Odoo 18 Sale Order
How to Change Sequence Number in Odoo 18 Sale OrderHow to Change Sequence Number in Odoo 18 Sale Order
How to Change Sequence Number in Odoo 18 Sale Order
Celine George
 
Capitol Doctoral Presentation -May 2025.pptx
Capitol Doctoral Presentation -May 2025.pptxCapitol Doctoral Presentation -May 2025.pptx
Capitol Doctoral Presentation -May 2025.pptx
CapitolTechU
 
PUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for HealthPUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for Health
JonathanHallett4
 
IPL QUIZ | THE QUIZ CLUB OF PSGCAS | 2025.pdf
IPL QUIZ | THE QUIZ CLUB OF PSGCAS | 2025.pdfIPL QUIZ | THE QUIZ CLUB OF PSGCAS | 2025.pdf
IPL QUIZ | THE QUIZ CLUB OF PSGCAS | 2025.pdf
Quiz Club of PSG College of Arts & Science
 
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFAMCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
20250515 Ntegra San Francisco 20250515 v15.pptx
20250515 Ntegra San Francisco 20250515 v15.pptx20250515 Ntegra San Francisco 20250515 v15.pptx
20250515 Ntegra San Francisco 20250515 v15.pptx
home
 
Statement by Linda McMahon on May 21, 2025
Statement by Linda McMahon on May 21, 2025Statement by Linda McMahon on May 21, 2025
Statement by Linda McMahon on May 21, 2025
Mebane Rash
 
A report on the county distress rankings in NC
A report on the county distress rankings in NCA report on the county distress rankings in NC
A report on the county distress rankings in NC
Mebane Rash
 
How to Manage Cross Selling in Odoo 18 Sales
How to Manage Cross Selling in Odoo 18 SalesHow to Manage Cross Selling in Odoo 18 Sales
How to Manage Cross Selling in Odoo 18 Sales
Celine George
 
libbys peer assesment.docx..............
libbys peer assesment.docx..............libbys peer assesment.docx..............
libbys peer assesment.docx..............
19lburrell
 
UNITED_KINGDOM.pptUNITED_KINGDOM.pptUNITED_KINGDOM.ppt
UNITED_KINGDOM.pptUNITED_KINGDOM.pptUNITED_KINGDOM.pptUNITED_KINGDOM.pptUNITED_KINGDOM.pptUNITED_KINGDOM.ppt
UNITED_KINGDOM.pptUNITED_KINGDOM.pptUNITED_KINGDOM.ppt
lsitinova
 
The Pedagogy We Practice: Best Practices for Critical Instructional Design
The Pedagogy We Practice: Best Practices for Critical Instructional DesignThe Pedagogy We Practice: Best Practices for Critical Instructional Design
The Pedagogy We Practice: Best Practices for Critical Instructional Design
Sean Michael Morris
 
How to Manage Manual Reordering Rule in Odoo 18 Inventory
How to Manage Manual Reordering Rule in Odoo 18 InventoryHow to Manage Manual Reordering Rule in Odoo 18 Inventory
How to Manage Manual Reordering Rule in Odoo 18 Inventory
Celine George
 
Letter to Secretary Linda McMahon from U.S. Senators
Letter to Secretary Linda McMahon from U.S. SenatorsLetter to Secretary Linda McMahon from U.S. Senators
Letter to Secretary Linda McMahon from U.S. Senators
Mebane Rash
 
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
parmarjuli1412
 
How to Add Button in Chatter in Odoo 18 - Odoo Slides
How to Add Button in Chatter in Odoo 18 - Odoo SlidesHow to Add Button in Chatter in Odoo 18 - Odoo Slides
How to Add Button in Chatter in Odoo 18 - Odoo Slides
Celine George
 
PUBH1000 Slides - Module 12: Advocacy for Health
PUBH1000 Slides - Module 12: Advocacy for HealthPUBH1000 Slides - Module 12: Advocacy for Health
PUBH1000 Slides - Module 12: Advocacy for Health
JonathanHallett4
 
How to Change Sequence Number in Odoo 18 Sale Order
How to Change Sequence Number in Odoo 18 Sale OrderHow to Change Sequence Number in Odoo 18 Sale Order
How to Change Sequence Number in Odoo 18 Sale Order
Celine George
 
Capitol Doctoral Presentation -May 2025.pptx
Capitol Doctoral Presentation -May 2025.pptxCapitol Doctoral Presentation -May 2025.pptx
Capitol Doctoral Presentation -May 2025.pptx
CapitolTechU
 
PUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for HealthPUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for Health
JonathanHallett4
 

Xml data transformation

  • 2. • XML was first introduced as a metalanguage for data description. • A metalanguage represents a well-defined interface that evolves and is transformed into derived languages. XML is simply the foundation interface for a number of specific markup languages, each of which is based on its own vocabulary and schema.
  • 3. • The schema syntactically differentiates XML languages from each other. XML is key for data exchange and interoperability, and the schema is essential for providing XML documents with a typed and well-defined structure. Unfortunately, in the imperfect world in which we live, schemas often express the same semantics through different syntaxes.
  • 4. • An XML transformation is simply the XML workaround for this relatively common situation. An XML transformation is a user-defined algorithm that attempts to express the semantics of a given document using another equivalent syntax. A transformation is much like a type cast in programming. You can always try to coerce the type, but in doing so you could face and accept compromises like syntax adaptations and, sometimes, loss of data and logic.
  • 5. • In XML, the transformation process is seen as the application of a style sheet to the source document. The style sheet is a declarative and user-defined document that is referred to as extensible. The term Extensible Stylesheet Language (XSL) indicates a metalanguage designed for expressing style sheets for XML documents. An XSL file contains the set of rules that will be used to transform a document into another,
  • 6. • XSL files were originally conceived as the XML counterpart of HTML's cascading style sheets (CSS). In this context, XSL files were simply extensible and user- definable tools to render an XML markup in HTML for display purposes. The growing complexity of style sheets, as well as the advent of XML schemas, changed the perspective of XSL and led to XSL Transformations (XSLT).
  • 7. • The goal of XSL has evolved over time. Today, XSL is a blanket term for a number of derived technologies that altogether better qualify and implement the original idea of styling XML documents. The various components that fall under the umbrella of XSL are the actual software entities that you use in your code:
  • 8. • XSLT Rule-based language for transforming XML documents into any other text-based format. XSLT provides for XML-to-XML transformation, which mostly means schema transformation. An XSLT program is a generic set of transformation rules whose output can be any text-based language, including HTML, Rich Text Format (RTF), and Wireless Markup
  • 9. • XPath Query language that XSLT programs use to select specific parts of an XML document. The result of XPath expressions is then parsed and elaborated by the XSLT processor
  • 10. • XSL Formatting Objects (XSL-FO) Advanced styling features expressed by • an XML vocabulary that define the semantics of a set of formatting • elements
  • 11. XSLT TEMPLATE PROGRAMMING XSLT is a process that combines two XML documents—the XML source file and the style sheet—to produce a third document. The resultant document can be an XML document, an HTML page, or any text-based file the style sheet has been instructed to generate. The source document must meet only one requirement: it must be a well-formed XML document. The style sheet must be a valid XML document that contains the transformation logic expressed using the elements in the XSLT vocabulary. An XSLT style sheet can be seen as a sequence of templates.
  • 12. AN OVERVIEW OF THE XSLT PROCESS
  • 13. • The core part of the transformation process is the application of templates to XML source elements. Other ancillary steps might include the expansion of elements to text, the execution of some script code, and the selection of a subset of nodes using Xpath queries. The layout of a generic XSLT script is shown here:
  • 14. • <xsl:stylesheet • xmlns:xsl="http://www.w3.org/1999/xsl/transform"> • <xsl:template match="/"> • ⋮ • </xsl:template> • <xsl:template match="..."> • ⋮ • </xsl:template> • ⋮ • </xsl:stylesheet>
  • 15. • The final output of each template must form a syntactically valid fragment in the target • language—be it XML, HTML, RTF, or some other language. You are not required to • indicate the target language explicitly, although the XSLT vocabulary provides a tailormade • instruction to declare what the expected output will be. The main requirement for • the XSLT style sheet is that its overall text be well-formed XML. In addition, it must • make syntactically correct use of all the XSLT instructions it needs. The
  • 16. APPLYING AN XSLT TEMPLATE TO SOURCE MARKUP TEXT.
  • 17. XSLT INSTRUCTIONS • The XSLT vocabulary consists of special tags that represent particular operations you • can perform on the source markup text or passed arguments. Although the overall • syntax is that of a rigorous XML dialect, you can easily recognize the main constructs of a high-level programming language. • The following subsections summarize the main XSLT instructions you are likely to run • across in your XSLT experience. The XSLT instructions are divided into four categories:
  • 19. THE STYLE SHEET IS FIRST NORMALIZED TO AN XPATH NAVIGATOR AND THEN COMPILED
  • 20. MANAGING THE PROCESSOR'S STATE • The style sheet compiler populates three internal data structures with the data read from the source.
  翻译: