SlideShare ist ein Scribd-Unternehmen logo
1 von 21
 An XML transformation language is
a programming language designed
specifically to transform
an input XML document into an output
document which satisfies some specific goal.
 There are two special cases of
transformation:
 XML to XML: the output document is an XML
document.
 XML to Data: the output document is a byte
stream.
 XSLT
- XSLT is a language for transforming
XML documents into XHTML documents or
to other XML documents.
 XPATH
- XPath is a language for navigating in XML
documents.
 XQUERY
- XQuery was designed to query XML data.
 XSLT stands for XSL Transformations
 XSLT is the most important part of XSL
 XSL stands for
EXtensible Stylesheet Language.
 XSL describes how the XML document should
be displayed
 XSLT transforms an XML document into
another XML document
 XSLT uses XPath to navigate in XML
documents
 XSLT is a W3C Recommendation
 The root element that declares the document
to be an XSL style sheet is <xsl:stylesheet>
or <xsl:transform>.
 <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Tr
ansform">
 Or
 <xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Tr
ansform">
 XPath is used to navigate through elements and
attributes in an XML document.
 XPath is a syntax for defining parts of an XML
document
 XPath uses path expressions to navigate in XML
documents
 XPath contains a library of standard functions
 XPath is a major element in XSLT
 XPath is a W3C recommendation
 XPath uses path expressions to select nodes or
node-sets in an XML document.
 The <xsl:template> element is used to build
templates.
 The match attribute is used to associate a
template with an XML element. The match
attribute can also be used to define a
template for the entire XML document. The
value of the match attribute is an XPath
expression (i.e. match="/" defines the whole
document).
 The <xsl:value-of> Element
 The <xsl:value-of> element can be used to
extract the value of an XML element and add
it to the Output stream of the transformation
 The <xsl:for-each> Element
 The XSL <xsl:for-each> element can be used
to select every XML element of a specified
node-set:
 Example:
 We want to transform the following XML document ("cdcatalog.xml") into HTML:
 <?xml version="1.0" encoding="UTF-8"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Hide your heart</title>
<artist>Bonnie Tyler</artist>
<country>USA</country>
<company>Columbia</company>
<price>20.90</price>
<year>1986</year>
</cd>
</catalog>
Save it as cdcatalog.xml
 Then you create an XSL Style Sheet ("cdcatalog.xsl") with a transformation template:
 <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Add the XSL style sheet reference to your XML document ("cdcatalog.xml"):
 <?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Hide your heart</title>
<artist>Bonnie Tyler</artist>
<country>USA</country>
<company>Columbia</company>
<price>20.90</price>
<year>1986</year>
</cd>
</catalog>
 XQuery is designed to query XML data - not
just XML files, but anything that can appear
as XML, including databases.
 XQuery is the language for querying XML data
 XQuery for XML is like SQL for databases
 XQuery is built on XPath expressions
 XQuery is supported by all major databases
 XQuery is a W3C Recommendation
 XQuery is a language for finding and
extracting elements and attributes from XML
documents.
 Functions
 XQuery uses functions to extract data from
XML documents.
 The doc() function is used to open the
"books.xml" file:
 doc("books.xml")
 Path Expressions
 XQuery uses path expressions to navigate
through elements in an XML document.
 The following path expression is used to
select all the title elements in the "books.xml"
file:
 doc("books.xml")/bookstore/book/title
 (/bookstore selects the bookstore element,
/book selects all the book elements under the
bookstore element, and /title selects all the
title elements under each book element)
 doc("books.xml")/bookstore/book[price>30]/
title
 The expression above will select all the title
elements under the book elements that are
under the bookstore element that have a
price element with a value that is higher than
30.
 XLink is short for XML Linking Language
 XLink is used to create hyperlinks in XML
documents
 Any element in an XML document can behave as
a link
 XLink supports simple links (like HTML) and
extended links (for linking multiple resources
together)
 With XLink, the links can be defined outside the
linked files
 XLink is a W3C Recommendation
 <?xml version="1.0" encoding="UTF-8"?>
<homepages
xmlns:xlink="http://www.w3.org/1999/xlink">
<homepage xlink:type="simple"
xlink:href="http://www.w3schools.com">Visit
W3Schools</homepage>
<homepage xlink:type="simple"
xlink:href="http://www.w3.org">Visit
W3C</homepage>
</homepages>
 http://www.w3schools.com
 http://en.wikipedia.org/wiki/XML_transforma
tion_language

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
yht4ever
 
Xml Presentation-3
Xml Presentation-3Xml Presentation-3
Xml Presentation-3
Sudharsan S
 

Was ist angesagt? (20)

XML
XMLXML
XML
 
XSD
XSDXSD
XSD
 
Xslt
XsltXslt
Xslt
 
Xpath.ppt
Xpath.pptXpath.ppt
Xpath.ppt
 
XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD Overview
 
Xml presentation
Xml presentationXml presentation
Xml presentation
 
XSLT. Basic.
XSLT. Basic.XSLT. Basic.
XSLT. Basic.
 
XML DTD and Schema
XML DTD and SchemaXML DTD and Schema
XML DTD and Schema
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
XML Schemas
XML SchemasXML Schemas
XML Schemas
 
Html forms
Html formsHtml forms
Html forms
 
Xslt elements
Xslt elementsXslt elements
Xslt elements
 
Xml schema
Xml schemaXml schema
Xml schema
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
XML Introduction
XML IntroductionXML Introduction
XML Introduction
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
jQuery - Chapter 3 - Effects
jQuery - Chapter 3 - Effects  jQuery - Chapter 3 - Effects
jQuery - Chapter 3 - Effects
 
XSLT
XSLTXSLT
XSLT
 
Xml
XmlXml
Xml
 
Xml Presentation-3
Xml Presentation-3Xml Presentation-3
Xml Presentation-3
 

Andere mochten auch

Question Four
Question FourQuestion Four
Question Four
bethxl
 
Bao cao jua ki
Bao cao jua kiBao cao jua ki
Bao cao jua ki
Tuan Huy
 
Biotechnology august2013-130926012214-phpapp02
Biotechnology august2013-130926012214-phpapp02Biotechnology august2013-130926012214-phpapp02
Biotechnology august2013-130926012214-phpapp02
Supa Buoy
 
Visita al cole de una ilustradora
Visita al cole de una ilustradoraVisita al cole de una ilustradora
Visita al cole de una ilustradora
1ciclo2013-14
 
Energia eva georgana 4rtA
Energia eva georgana 4rtAEnergia eva georgana 4rtA
Energia eva georgana 4rtA
evaelfk
 
Module thong ke truy cap va footer
Module thong ke truy cap va footerModule thong ke truy cap va footer
Module thong ke truy cap va footer
Tuan Huy
 
GIL_2012_Africa_BU_Presentation_on_Mega_Trends_Africa_Telecoms_and_IT_by_Chan...
GIL_2012_Africa_BU_Presentation_on_Mega_Trends_Africa_Telecoms_and_IT_by_Chan...GIL_2012_Africa_BU_Presentation_on_Mega_Trends_Africa_Telecoms_and_IT_by_Chan...
GIL_2012_Africa_BU_Presentation_on_Mega_Trends_Africa_Telecoms_and_IT_by_Chan...
Chantel Lindeman
 

Andere mochten auch (18)

Lebowski Publishers - Najaar 2014
Lebowski Publishers - Najaar 2014Lebowski Publishers - Najaar 2014
Lebowski Publishers - Najaar 2014
 
Question Four
Question FourQuestion Four
Question Four
 
Bao cao jua ki
Bao cao jua kiBao cao jua ki
Bao cao jua ki
 
Mypp
MyppMypp
Mypp
 
Biotechnology august2013-130926012214-phpapp02
Biotechnology august2013-130926012214-phpapp02Biotechnology august2013-130926012214-phpapp02
Biotechnology august2013-130926012214-phpapp02
 
North east
North eastNorth east
North east
 
Clase de ed
Clase de edClase de ed
Clase de ed
 
about Pangkalpinang in English
about Pangkalpinang in Englishabout Pangkalpinang in English
about Pangkalpinang in English
 
Visita al cole de una ilustradora
Visita al cole de una ilustradoraVisita al cole de una ilustradora
Visita al cole de una ilustradora
 
Elsevier: CSUN Alt Text Project
Elsevier: CSUN Alt Text ProjectElsevier: CSUN Alt Text Project
Elsevier: CSUN Alt Text Project
 
Hosting
HostingHosting
Hosting
 
Bar charts for questtionnaire
Bar charts for questtionnaireBar charts for questtionnaire
Bar charts for questtionnaire
 
Energia eva georgana 4rtA
Energia eva georgana 4rtAEnergia eva georgana 4rtA
Energia eva georgana 4rtA
 
Module thong ke truy cap va footer
Module thong ke truy cap va footerModule thong ke truy cap va footer
Module thong ke truy cap va footer
 
Designing & Managing Product
Designing & Managing ProductDesigning & Managing Product
Designing & Managing Product
 
Representation
RepresentationRepresentation
Representation
 
What can my school of talk do for you
What can my school of talk do for youWhat can my school of talk do for you
What can my school of talk do for you
 
GIL_2012_Africa_BU_Presentation_on_Mega_Trends_Africa_Telecoms_and_IT_by_Chan...
GIL_2012_Africa_BU_Presentation_on_Mega_Trends_Africa_Telecoms_and_IT_by_Chan...GIL_2012_Africa_BU_Presentation_on_Mega_Trends_Africa_Telecoms_and_IT_by_Chan...
GIL_2012_Africa_BU_Presentation_on_Mega_Trends_Africa_Telecoms_and_IT_by_Chan...
 

Ähnlich wie Xml transformation language (20)

Xslt
XsltXslt
Xslt
 
Xslt
XsltXslt
Xslt
 
Introduction to XSLT
Introduction to XSLTIntroduction to XSLT
Introduction to XSLT
 
XPATH_XSLT-1.pptx
XPATH_XSLT-1.pptxXPATH_XSLT-1.pptx
XPATH_XSLT-1.pptx
 
Xslt
XsltXslt
Xslt
 
Integrative Programming and Technology Chapter 4- Dr. J. VijiPriya
Integrative Programming and Technology Chapter 4- Dr. J. VijiPriyaIntegrative Programming and Technology Chapter 4- Dr. J. VijiPriya
Integrative Programming and Technology Chapter 4- Dr. J. VijiPriya
 
Overview of XSL, XPath and XSL-FO
Overview of XSL, XPath and XSL-FOOverview of XSL, XPath and XSL-FO
Overview of XSL, XPath and XSL-FO
 
Session 4
Session 4Session 4
Session 4
 
Xml 2
Xml  2 Xml  2
Xml 2
 
Chapter 18
Chapter 18Chapter 18
Chapter 18
 
Xml
XmlXml
Xml
 
Xml nisha dwivedi
Xml nisha dwivediXml nisha dwivedi
Xml nisha dwivedi
 
Xml 215-presentation
Xml 215-presentationXml 215-presentation
Xml 215-presentation
 
Xml and DTD's
Xml and DTD'sXml and DTD's
Xml and DTD's
 
Rendering XML Documents
Rendering XML DocumentsRendering XML Documents
Rendering XML Documents
 
Introduction of xml and xslt
Introduction of xml and xsltIntroduction of xml and xslt
Introduction of xml and xslt
 
XML/XSLT
XML/XSLTXML/XSLT
XML/XSLT
 
Xslt attributes
Xslt attributesXslt attributes
Xslt attributes
 
transforming xml using xsl and xslt
transforming xml using xsl and xslttransforming xml using xsl and xslt
transforming xml using xsl and xslt
 
Xml session
Xml sessionXml session
Xml session
 

Kürzlich hochgeladen

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Xml transformation language

  • 1.
  • 2.  An XML transformation language is a programming language designed specifically to transform an input XML document into an output document which satisfies some specific goal.  There are two special cases of transformation:  XML to XML: the output document is an XML document.  XML to Data: the output document is a byte stream.
  • 3.  XSLT - XSLT is a language for transforming XML documents into XHTML documents or to other XML documents.  XPATH - XPath is a language for navigating in XML documents.  XQUERY - XQuery was designed to query XML data.
  • 4.  XSLT stands for XSL Transformations  XSLT is the most important part of XSL  XSL stands for EXtensible Stylesheet Language.  XSL describes how the XML document should be displayed  XSLT transforms an XML document into another XML document  XSLT uses XPath to navigate in XML documents  XSLT is a W3C Recommendation
  • 5.  The root element that declares the document to be an XSL style sheet is <xsl:stylesheet> or <xsl:transform>.  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Tr ansform">  Or  <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Tr ansform">
  • 6.  XPath is used to navigate through elements and attributes in an XML document.  XPath is a syntax for defining parts of an XML document  XPath uses path expressions to navigate in XML documents  XPath contains a library of standard functions  XPath is a major element in XSLT  XPath is a W3C recommendation  XPath uses path expressions to select nodes or node-sets in an XML document.
  • 7.
  • 8.
  • 9.  The <xsl:template> element is used to build templates.  The match attribute is used to associate a template with an XML element. The match attribute can also be used to define a template for the entire XML document. The value of the match attribute is an XPath expression (i.e. match="/" defines the whole document).
  • 10.  The <xsl:value-of> Element  The <xsl:value-of> element can be used to extract the value of an XML element and add it to the Output stream of the transformation  The <xsl:for-each> Element  The XSL <xsl:for-each> element can be used to select every XML element of a specified node-set:
  • 11.  Example:  We want to transform the following XML document ("cdcatalog.xml") into HTML:  <?xml version="1.0" encoding="UTF-8"?> <catalog> <cd> <title>Empire Burlesque</title> <artist>Bob Dylan</artist> <country>USA</country> <company>Columbia</company> <price>10.90</price> <year>1985</year> </cd> <cd> <title>Hide your heart</title> <artist>Bonnie Tyler</artist> <country>USA</country> <company>Columbia</company> <price>20.90</price> <year>1986</year> </cd> </catalog> Save it as cdcatalog.xml
  • 12.  Then you create an XSL Style Sheet ("cdcatalog.xsl") with a transformation template:  <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <h2>My CD Collection</h2> <table border="1"> <tr bgcolor="#9acd32"> <th>Title</th> <th>Artist</th> </tr> <xsl:for-each select="catalog/cd"> <tr> <td><xsl:value-of select="title"/></td> <td><xsl:value-of select="artist"/></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet>
  • 13. Add the XSL style sheet reference to your XML document ("cdcatalog.xml"):  <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?> <catalog> <cd> <title>Empire Burlesque</title> <artist>Bob Dylan</artist> <country>USA</country> <company>Columbia</company> <price>10.90</price> <year>1985</year> </cd> <cd> <title>Hide your heart</title> <artist>Bonnie Tyler</artist> <country>USA</country> <company>Columbia</company> <price>20.90</price> <year>1986</year> </cd> </catalog>
  • 14.
  • 15.  XQuery is designed to query XML data - not just XML files, but anything that can appear as XML, including databases.  XQuery is the language for querying XML data  XQuery for XML is like SQL for databases  XQuery is built on XPath expressions  XQuery is supported by all major databases  XQuery is a W3C Recommendation  XQuery is a language for finding and extracting elements and attributes from XML documents.
  • 16.  Functions  XQuery uses functions to extract data from XML documents.  The doc() function is used to open the "books.xml" file:  doc("books.xml")
  • 17.  Path Expressions  XQuery uses path expressions to navigate through elements in an XML document.  The following path expression is used to select all the title elements in the "books.xml" file:  doc("books.xml")/bookstore/book/title  (/bookstore selects the bookstore element, /book selects all the book elements under the bookstore element, and /title selects all the title elements under each book element)
  • 18.  doc("books.xml")/bookstore/book[price>30]/ title  The expression above will select all the title elements under the book elements that are under the bookstore element that have a price element with a value that is higher than 30.
  • 19.  XLink is short for XML Linking Language  XLink is used to create hyperlinks in XML documents  Any element in an XML document can behave as a link  XLink supports simple links (like HTML) and extended links (for linking multiple resources together)  With XLink, the links can be defined outside the linked files  XLink is a W3C Recommendation
  • 20.  <?xml version="1.0" encoding="UTF-8"?> <homepages xmlns:xlink="http://www.w3.org/1999/xlink"> <homepage xlink:type="simple" xlink:href="http://www.w3schools.com">Visit W3Schools</homepage> <homepage xlink:type="simple" xlink:href="http://www.w3.org">Visit W3C</homepage> </homepages>