SlideShare a Scribd company logo
eXentensible Stylysheet
Language (XSL)
A BRIEF INTRODUCTION TO XSL 2.0 IN THE CTDA
XSL
XSL is eXtensible Stylesheet Language for XML documents. XSLT stands for XSL Transformations.
Are you familiar with CSS (or cascading stylesheets) for HTML?
XSL helps to display XML documents and includes:
• XSLT – language for transforming XML documents
• XPath – language for navigating XML documents
• XSL-FO – language for formatting XML documents
In this presentation, we will be looking at XSLT 2.0 and XPath to transform an XML document into another
XML document.
XPath
XML is a document and uses a language called XPath to navigate these documents. Xpath is
essentially to know for XSL.
XPath navigates “nodes” and there are 7:
◦ Elements
◦ Attributes
◦ Text
◦ Namespace
◦ Processing-instruction (<?name value?>
◦ Comment (<!-- -->)
◦ Document nodes
XPath and Nodes
The XML document is a tree of nodes.
In this example….
<bookstore> is the root element node
<author> is the element node
lang=“en” is the attribute node
Harry Potter or “en” are Atomic values or Items.
<book> is the child of <bookstore>
<title> is the sibling of <author>
What is <year>?
<book> and <bookstore> are the ancestors of <title>
What are the descendants of <bookstore>?
Selecting Nodes
Examples
Wildcards
Selecting 1+ Nodes
Start with an XML document
We’re working with a very small MODS export from Open Refine
Open-Refined-Farrel-xslx.txt
Before anything, rename this file with the extension “.xml”. Then, open this up in your xml editor
and remove all “null”. You might also have to take care of & or any html that you forgot to strip
in Open Refine such as <br>. You can use the Find and Replace Function in your text editor.
XML Document
What is the structure of this XML document? Can you find the root element? What are the
siblings, ancestors, descendants, etc.?
Is the XML document associated with a metadata standard? What is that standard and its
requirements?
What do you want to do?
Now that you understand the structure of your XML document, what do you want to do with it?
It is necessary to construct a sort of story about your XML document.
In the CTDA, we want to create individual MODS records that follow the CTDA MODS
implementation guidelines from the source XML document.
This is only one story. You can do other things with XSLT such as:
• I want to display my XML document in any browser.
• I want to count how many times the word “the” is used.
• Etc.
We want MODS XML documents
We have a source XML document. In our example, how many result MODS XML documents do
we need?
Does the source XML document and resulting MODS XML documents have the same structure?
What’s different?
What is our story?
Our tale begins with a small XML document. This xml file is not
associated with any namespace, and hence prefixes. It is not
associated with any metadata standard. This xml file has only 2
records.
The xml file has the following outline:
Root: metadata
Child of metadata: record
Children of record (grandchildren of metadata): Title, Creator,
Place, Topic, TopicPerson, Genre, Contributors, Datecreated,
FileName, Source, Collection, Rights
Story Continued
We want to create a folder (preferably) that
contains the individual MODS Records.
Each MODS record should preferably have the
file name of the image which is a condition of
the batch import. If not, you can generate a
random id with XSL.
Each MODS record must be well-formed and
valid according to the MODS schema and the
CTDA MODS Guidelines.
Story Ends
XSLT
XSLT must begin with the correct declaration.
<?xml version=“1.0” encoding=“UTF-8”?>
<xsl:stylesheet version=“2.0” xmlns:xsl=“http://www.w3.org/1999/XSL/Transform”>
•XSLT consists of one or more set of rules that are called templates.
•XSLT has a number of elements that help manipulate values of selected nodes or elements in
your source XML document.
<xsl:value-of> is used to extract the value of an XML element
<xsl:for-each> is used to select every XML element in a specific node-set
<xsl:choose> is used to express multiple conditional tests
<xsl:result-document> is used to write output to a file or directory.
Let’s create our 1st XSLT 2.0 Document
Questions?

More Related Content

What's hot

10. XML in DBMS
10. XML in DBMS10. XML in DBMS
10. XML in DBMS
koolkampus
 
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
 
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 schema
Xml schemaXml schema
Xml schema
Dr.Saranya K.G
 
01 xml document structure
01 xml document structure01 xml document structure
01 xml document structure
Baskarkncet
 
XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD Overview
Pradeep Rapolu
 
XML.ppt
XML.pptXML.ppt
XML.ppt
butest
 
Xml and xml processor
Xml and xml processorXml and xml processor
Xml and xml processor
Himanshu Soni
 
HTML and XML Difference FAQs
HTML and XML Difference FAQsHTML and XML Difference FAQs
HTML and XML Difference FAQs
Umar Ali
 
Xml
XmlXml
Xml schema
Xml schemaXml schema
Xml schema
Akshaya Akshaya
 
Xml presentation
Xml presentationXml presentation
Xml presentation
Miguel Angel Teheran Garcia
 
XML-Extensible Markup Language
XML-Extensible Markup Language XML-Extensible Markup Language
XML-Extensible Markup Language
Ann Joseph
 
XML
XMLXML
Xml basics for beginning
Xml basics for beginningXml basics for beginning
Xml basics for beginning
Ahmad Awsaf-uz-zaman
 
Dtd
DtdDtd
Introduction to xml schema
Introduction to xml schemaIntroduction to xml schema
Introduction to xml schema
Abhishek Kesharwani
 
Basics of XML
Basics of XMLBasics of XML
Basics of XML
indiangarg
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
Abhra Basak
 

What's hot (20)

10. XML in DBMS
10. XML in DBMS10. XML in DBMS
10. XML in DBMS
 
uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2
 
Introduction to XML and Databases
Introduction to XML and DatabasesIntroduction to XML and Databases
Introduction to XML and Databases
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Xml schema
Xml schemaXml schema
Xml schema
 
01 xml document structure
01 xml document structure01 xml document structure
01 xml document structure
 
XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD Overview
 
XML.ppt
XML.pptXML.ppt
XML.ppt
 
Xml and xml processor
Xml and xml processorXml and xml processor
Xml and xml processor
 
HTML and XML Difference FAQs
HTML and XML Difference FAQsHTML and XML Difference FAQs
HTML and XML Difference FAQs
 
Xml
XmlXml
Xml
 
Xml schema
Xml schemaXml schema
Xml schema
 
Xml presentation
Xml presentationXml presentation
Xml presentation
 
XML-Extensible Markup Language
XML-Extensible Markup Language XML-Extensible Markup Language
XML-Extensible Markup Language
 
XML
XMLXML
XML
 
Xml basics for beginning
Xml basics for beginningXml basics for beginning
Xml basics for beginning
 
Dtd
DtdDtd
Dtd
 
Introduction to xml schema
Introduction to xml schemaIntroduction to xml schema
Introduction to xml schema
 
Basics of XML
Basics of XMLBasics of XML
Basics of XML
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 

Viewers also liked

CTDA Overview September 2016
CTDA Overview September 2016CTDA Overview September 2016
CTDA Overview September 2016
University of Connecticut Libraries
 
How to Add Or Replace a Datastream
How to Add Or Replace  a DatastreamHow to Add Or Replace  a Datastream
How to Add Or Replace a Datastream
University of Connecticut Libraries
 
CTDA Brown Bag, Dec. 2016
CTDA Brown Bag, Dec. 2016CTDA Brown Bag, Dec. 2016
CTDA Brown Bag, Dec. 2016
University of Connecticut Libraries
 
CTDA MODS and Islandora XML Forms
CTDA MODS and Islandora XML FormsCTDA MODS and Islandora XML Forms
CTDA MODS and Islandora XML Forms
University of Connecticut Libraries
 
CTDA Metadata Application Profile
CTDA Metadata Application ProfileCTDA Metadata Application Profile
CTDA Metadata Application Profile
University of Connecticut Libraries
 
Collaborative Data Archiving and Access: Developing a Shared Repository Infra...
Collaborative Data Archiving and Access: Developing a Shared Repository Infra...Collaborative Data Archiving and Access: Developing a Shared Repository Infra...
Collaborative Data Archiving and Access: Developing a Shared Repository Infra...
University of Connecticut Libraries
 
A Cloud of Your Own: Preservation & Access Services from the Connecticut Digi...
A Cloud of Your Own: Preservation & Access Services from the Connecticut Digi...A Cloud of Your Own: Preservation & Access Services from the Connecticut Digi...
A Cloud of Your Own: Preservation & Access Services from the Connecticut Digi...
University of Connecticut Libraries
 
Seeing Connecticut Now and Then: Repository Services that Support Your Best M...
Seeing Connecticut Now and Then: Repository Services that Support Your Best M...Seeing Connecticut Now and Then: Repository Services that Support Your Best M...
Seeing Connecticut Now and Then: Repository Services that Support Your Best M...
University of Connecticut Libraries
 
CTDA Flyer 2016
CTDA Flyer 2016CTDA Flyer 2016
CTDA Brown Bag, Oct. 2016
CTDA Brown Bag, Oct. 2016CTDA Brown Bag, Oct. 2016
CTDA Brown Bag, Oct. 2016
University of Connecticut Libraries
 
CTDA Annual Meeting 2016
CTDA Annual Meeting 2016CTDA Annual Meeting 2016
CTDA Annual Meeting 2016
University of Connecticut Libraries
 
We Don't Make Your Preservation Program, We Make Your Preservation Program Be...
We Don't Make Your Preservation Program, We Make Your Preservation Program Be...We Don't Make Your Preservation Program, We Make Your Preservation Program Be...
We Don't Make Your Preservation Program, We Make Your Preservation Program Be...
University of Connecticut Libraries
 
How to Add A Compound Object
How to Add A Compound ObjectHow to Add A Compound Object
How to Add A Compound Object
University of Connecticut Libraries
 
CTDA End of Year Reports
CTDA End of Year ReportsCTDA End of Year Reports
CTDA End of Year Reports
University of Connecticut Libraries
 
How to Use the Manuscript Content Model
How to Use the Manuscript Content ModelHow to Use the Manuscript Content Model
How to Use the Manuscript Content Model
University of Connecticut Libraries
 
CTDA MODS Implementation Guidelines
CTDA MODS Implementation GuidelinesCTDA MODS Implementation Guidelines
CTDA MODS Implementation Guidelines
University of Connecticut Libraries
 
CTDA Brown Bag, Feb. 2017
CTDA Brown Bag, Feb. 2017CTDA Brown Bag, Feb. 2017
CTDA Brown Bag, Feb. 2017
University of Connecticut Libraries
 
CTDA: Brief Introduction
CTDA: Brief IntroductionCTDA: Brief Introduction
CTDA: Brief Introduction
University of Connecticut Libraries
 
Open refine to update and clean up your messy data
Open refine to update and clean up your messy dataOpen refine to update and clean up your messy data
Open refine to update and clean up your messy data
University of Connecticut Libraries
 
Web Services
Web ServicesWeb Services
Web Services
Gaurav Tyagi
 

Viewers also liked (20)

CTDA Overview September 2016
CTDA Overview September 2016CTDA Overview September 2016
CTDA Overview September 2016
 
How to Add Or Replace a Datastream
How to Add Or Replace  a DatastreamHow to Add Or Replace  a Datastream
How to Add Or Replace a Datastream
 
CTDA Brown Bag, Dec. 2016
CTDA Brown Bag, Dec. 2016CTDA Brown Bag, Dec. 2016
CTDA Brown Bag, Dec. 2016
 
CTDA MODS and Islandora XML Forms
CTDA MODS and Islandora XML FormsCTDA MODS and Islandora XML Forms
CTDA MODS and Islandora XML Forms
 
CTDA Metadata Application Profile
CTDA Metadata Application ProfileCTDA Metadata Application Profile
CTDA Metadata Application Profile
 
Collaborative Data Archiving and Access: Developing a Shared Repository Infra...
Collaborative Data Archiving and Access: Developing a Shared Repository Infra...Collaborative Data Archiving and Access: Developing a Shared Repository Infra...
Collaborative Data Archiving and Access: Developing a Shared Repository Infra...
 
A Cloud of Your Own: Preservation & Access Services from the Connecticut Digi...
A Cloud of Your Own: Preservation & Access Services from the Connecticut Digi...A Cloud of Your Own: Preservation & Access Services from the Connecticut Digi...
A Cloud of Your Own: Preservation & Access Services from the Connecticut Digi...
 
Seeing Connecticut Now and Then: Repository Services that Support Your Best M...
Seeing Connecticut Now and Then: Repository Services that Support Your Best M...Seeing Connecticut Now and Then: Repository Services that Support Your Best M...
Seeing Connecticut Now and Then: Repository Services that Support Your Best M...
 
CTDA Flyer 2016
CTDA Flyer 2016CTDA Flyer 2016
CTDA Flyer 2016
 
CTDA Brown Bag, Oct. 2016
CTDA Brown Bag, Oct. 2016CTDA Brown Bag, Oct. 2016
CTDA Brown Bag, Oct. 2016
 
CTDA Annual Meeting 2016
CTDA Annual Meeting 2016CTDA Annual Meeting 2016
CTDA Annual Meeting 2016
 
We Don't Make Your Preservation Program, We Make Your Preservation Program Be...
We Don't Make Your Preservation Program, We Make Your Preservation Program Be...We Don't Make Your Preservation Program, We Make Your Preservation Program Be...
We Don't Make Your Preservation Program, We Make Your Preservation Program Be...
 
How to Add A Compound Object
How to Add A Compound ObjectHow to Add A Compound Object
How to Add A Compound Object
 
CTDA End of Year Reports
CTDA End of Year ReportsCTDA End of Year Reports
CTDA End of Year Reports
 
How to Use the Manuscript Content Model
How to Use the Manuscript Content ModelHow to Use the Manuscript Content Model
How to Use the Manuscript Content Model
 
CTDA MODS Implementation Guidelines
CTDA MODS Implementation GuidelinesCTDA MODS Implementation Guidelines
CTDA MODS Implementation Guidelines
 
CTDA Brown Bag, Feb. 2017
CTDA Brown Bag, Feb. 2017CTDA Brown Bag, Feb. 2017
CTDA Brown Bag, Feb. 2017
 
CTDA: Brief Introduction
CTDA: Brief IntroductionCTDA: Brief Introduction
CTDA: Brief Introduction
 
Open refine to update and clean up your messy data
Open refine to update and clean up your messy dataOpen refine to update and clean up your messy data
Open refine to update and clean up your messy data
 
Web Services
Web ServicesWeb Services
Web Services
 

Similar to CTDA Workshop on XSL

eXtensible Markup Language
eXtensible Markup LanguageeXtensible Markup Language
eXtensible Markup Language
Aditya Raj
 
Xml iet 2015
Xml iet 2015Xml iet 2015
Xml iet 2015
kiransurariya
 
XML/XSLT
XML/XSLTXML/XSLT
XML/XSLT
thinkahead.net
 
unit_5_XML data integration database management
unit_5_XML data integration database managementunit_5_XML data integration database management
unit_5_XML data integration database management
sathiyabcsbs
 
Xml and DTD's
Xml and DTD'sXml and DTD's
Xml and DTD's
Swati Parmar
 
DATA INTEGRATION (Gaining Access to Diverse Data).ppt
DATA INTEGRATION (Gaining Access to Diverse Data).pptDATA INTEGRATION (Gaining Access to Diverse Data).ppt
DATA INTEGRATION (Gaining Access to Diverse Data).ppt
careerPointBasti
 
Xslt
XsltXslt
Xslt
XsltXslt
Introduction to XSLT
Introduction to XSLTIntroduction to XSLT
Introduction to XSLT
Mahmoud Allam
 
Xsd
XsdXsd
Xsd
XsdXsd
Introduction of xml and xslt
Introduction of xml and xsltIntroduction of xml and xslt
Introduction of xml and xslt
TUSHAR VARSHNEY
 
advDBMS_XML.pptx
advDBMS_XML.pptxadvDBMS_XML.pptx
advDBMS_XML.pptx
IreneGetzi
 
XML1.pptx
XML1.pptxXML1.pptx
Xml intro1
Xml intro1Xml intro1
Oracle soa xml faq
Oracle soa xml faqOracle soa xml faq
Oracle soa xml faq
xavier john
 
Xml viva questions
Xml viva questionsXml viva questions
Xml viva questions
Vipul Naik
 
paper about xml
paper about xmlpaper about xml
eXtensible Markup Language (XML)
eXtensible Markup Language (XML)eXtensible Markup Language (XML)
eXtensible Markup Language (XML)
Serhii Kartashov
 
XML Fundamentals
XML FundamentalsXML Fundamentals

Similar to CTDA Workshop on XSL (20)

eXtensible Markup Language
eXtensible Markup LanguageeXtensible Markup Language
eXtensible Markup Language
 
Xml iet 2015
Xml iet 2015Xml iet 2015
Xml iet 2015
 
XML/XSLT
XML/XSLTXML/XSLT
XML/XSLT
 
unit_5_XML data integration database management
unit_5_XML data integration database managementunit_5_XML data integration database management
unit_5_XML data integration database management
 
Xml and DTD's
Xml and DTD'sXml and DTD's
Xml and DTD's
 
DATA INTEGRATION (Gaining Access to Diverse Data).ppt
DATA INTEGRATION (Gaining Access to Diverse Data).pptDATA INTEGRATION (Gaining Access to Diverse Data).ppt
DATA INTEGRATION (Gaining Access to Diverse Data).ppt
 
Xslt
XsltXslt
Xslt
 
Xslt
XsltXslt
Xslt
 
Introduction to XSLT
Introduction to XSLTIntroduction to XSLT
Introduction to XSLT
 
Xsd
XsdXsd
Xsd
 
Xsd
XsdXsd
Xsd
 
Introduction of xml and xslt
Introduction of xml and xsltIntroduction of xml and xslt
Introduction of xml and xslt
 
advDBMS_XML.pptx
advDBMS_XML.pptxadvDBMS_XML.pptx
advDBMS_XML.pptx
 
XML1.pptx
XML1.pptxXML1.pptx
XML1.pptx
 
Xml intro1
Xml intro1Xml intro1
Xml intro1
 
Oracle soa xml faq
Oracle soa xml faqOracle soa xml faq
Oracle soa xml faq
 
Xml viva questions
Xml viva questionsXml viva questions
Xml viva questions
 
paper about xml
paper about xmlpaper about xml
paper about xml
 
eXtensible Markup Language (XML)
eXtensible Markup Language (XML)eXtensible Markup Language (XML)
eXtensible Markup Language (XML)
 
XML Fundamentals
XML FundamentalsXML Fundamentals
XML Fundamentals
 

Recently uploaded

RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
S. Raj Kumar
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
สมใจ จันสุกสี
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
ssuser13ffe4
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 

Recently uploaded (20)

RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 

CTDA Workshop on XSL

  • 1. eXentensible Stylysheet Language (XSL) A BRIEF INTRODUCTION TO XSL 2.0 IN THE CTDA
  • 2. XSL XSL is eXtensible Stylesheet Language for XML documents. XSLT stands for XSL Transformations. Are you familiar with CSS (or cascading stylesheets) for HTML? XSL helps to display XML documents and includes: • XSLT – language for transforming XML documents • XPath – language for navigating XML documents • XSL-FO – language for formatting XML documents In this presentation, we will be looking at XSLT 2.0 and XPath to transform an XML document into another XML document.
  • 3. XPath XML is a document and uses a language called XPath to navigate these documents. Xpath is essentially to know for XSL. XPath navigates “nodes” and there are 7: ◦ Elements ◦ Attributes ◦ Text ◦ Namespace ◦ Processing-instruction (<?name value?> ◦ Comment (<!-- -->) ◦ Document nodes
  • 4. XPath and Nodes The XML document is a tree of nodes. In this example…. <bookstore> is the root element node <author> is the element node lang=“en” is the attribute node Harry Potter or “en” are Atomic values or Items. <book> is the child of <bookstore> <title> is the sibling of <author> What is <year>? <book> and <bookstore> are the ancestors of <title> What are the descendants of <bookstore>?
  • 9. Start with an XML document We’re working with a very small MODS export from Open Refine Open-Refined-Farrel-xslx.txt Before anything, rename this file with the extension “.xml”. Then, open this up in your xml editor and remove all “null”. You might also have to take care of & or any html that you forgot to strip in Open Refine such as <br>. You can use the Find and Replace Function in your text editor.
  • 10. XML Document What is the structure of this XML document? Can you find the root element? What are the siblings, ancestors, descendants, etc.? Is the XML document associated with a metadata standard? What is that standard and its requirements?
  • 11. What do you want to do? Now that you understand the structure of your XML document, what do you want to do with it? It is necessary to construct a sort of story about your XML document. In the CTDA, we want to create individual MODS records that follow the CTDA MODS implementation guidelines from the source XML document. This is only one story. You can do other things with XSLT such as: • I want to display my XML document in any browser. • I want to count how many times the word “the” is used. • Etc.
  • 12. We want MODS XML documents We have a source XML document. In our example, how many result MODS XML documents do we need? Does the source XML document and resulting MODS XML documents have the same structure? What’s different?
  • 13. What is our story? Our tale begins with a small XML document. This xml file is not associated with any namespace, and hence prefixes. It is not associated with any metadata standard. This xml file has only 2 records. The xml file has the following outline: Root: metadata Child of metadata: record Children of record (grandchildren of metadata): Title, Creator, Place, Topic, TopicPerson, Genre, Contributors, Datecreated, FileName, Source, Collection, Rights
  • 14. Story Continued We want to create a folder (preferably) that contains the individual MODS Records. Each MODS record should preferably have the file name of the image which is a condition of the batch import. If not, you can generate a random id with XSL. Each MODS record must be well-formed and valid according to the MODS schema and the CTDA MODS Guidelines.
  • 16. XSLT XSLT must begin with the correct declaration. <?xml version=“1.0” encoding=“UTF-8”?> <xsl:stylesheet version=“2.0” xmlns:xsl=“http://www.w3.org/1999/XSL/Transform”> •XSLT consists of one or more set of rules that are called templates. •XSLT has a number of elements that help manipulate values of selected nodes or elements in your source XML document. <xsl:value-of> is used to extract the value of an XML element <xsl:for-each> is used to select every XML element in a specific node-set <xsl:choose> is used to express multiple conditional tests <xsl:result-document> is used to write output to a file or directory.
  • 17. Let’s create our 1st XSLT 2.0 Document