XSLT and XPath, by Dr. Khalil1 XSL, XSLT and XPath Dr. Awad Khalil Computer Science Department AUC.

Slides:



Advertisements
Similar presentations
XML-XSL Introduction SHIJU RAJAN SHIJU RAJAN Outline Brief Overview Brief Overview What is XML? What is XML? Well Formed XML Well Formed XML Tag Name.
Advertisements

XML: Extensible Markup Language
UFCE8V-20-3 Information Systems Development 3 (SHAPE HK) Lecture 12 Extensible Stylesheet Language Transformations : XSLT.
1 XSLT – eXtensible Stylesheet Language Transformations Modified Slides from Dr. Sagiv.
XPath XML Path Language. Outline XML Path Language (XPath) Data Model Description Node values XPath expressions Relative expressions Simple subset of.
Transforming XML Part I Document Navigation with XPath John Arnett, MSc Standards Modeller Information and Statistics Division NHSScotland Tel:
XPath Eugenia Fernandez IUPUI. XML Path Language (XPath) a data model for representing an XML document as an abstract node tree a mechanism for addressing.
Rendering XML documents with XSL The most powerful approaches to rendering XML documents involve using XSL (eXtensible Stylesheet Language) XSL enables.
XSL Concepts Lecture 7. XML Display Options What can XSL Transformations do? generation of constant text suppression of content moving text (e.g., exchanging.
XML Language Family Detailed Examples Most information contained in these slide comes from: These slides are intended.
Lecture 12. Default Processing in XSLT The default processing in XSLT is to process the XPath root node The default processing for various node types.
XPath Tao Wan March 04, What is XPath? n A language designed to be used by XSL Transformations (XSLT), Xlink, Xpointer and XML Query. n Primary.
XML –Query Languages, Extracting from Relational Databases ADVANCED DATABASES Khawaja Mohiuddin Assistant Professor Department of Computer Sciences Bahria.
XML Technologies and Applications Rajshekhar Sunderraman Department of Computer Science Georgia State University Atlanta, GA 30302
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
17 Apr 2002 XML Stylesheets Andy Clark. What Is It? Extensible Stylesheet Language (XSL) Language for document transformation – Transformation (XSLT)
MC 365 – Software Engineering Presented by: John Ristuccia Shawn Posts Ndi Sampson XSLT Introduction BCi.
Manohar – Why XML is Required Problem: We want to save the data and retrieve it further or to transfer over the network. This.
Overview of XPath Author: Dan McCreary Date: October, 2008 Version: 0.2 with TEI Examples M D.
Introduction to XPath Bun Yue Professor, CS/CIS UHCL.
SD2520 Databases using XML and JQuery
ECA 228 Internet/Intranet Design I Intro to XSL. ECA 228 Internet/Intranet Design I XSL basics W3C standards for stylesheets – CSS – XSL: Extensible Markup.
10/06/041 XSLT: crash course or Programming Language Design Principle XSLT-intro.ppt 10, Jun, 2004.
Sheet 1XML Technology in E-Commerce 2001Lecture 6 XML Technology in E-Commerce Lecture 6 XPointer, XSLT.
Navigating XML. Overview  Xpath is a non-xml syntax to be used with XSLT and Xpointer. Its purpose according to the W3.org is  to address parts of an.
CSE3201/CSE4500 XPath. 2 XPath A locator for elements or attributes in an XML document. XPath expression gives direction.
TDDD43 XML and RDF Slides based on slides by Lena Strömbäck and Fang Wei-Kleiner 1.
1/17 ITApplications XML Module Session 7: Introduction to XPath.
IS432 Semi-Structured Data Lecture 5: XSLT Dr. Gamal Al-Shorbagy.
Introduction to XPath Web Engineering, SS 2007 Tomáš Pitner.
XSLT for Data Manipulation By: April Fleming. What We Will Cover The What, Why, When, and How of XSLT What tools you will need to get started A sample.
CSE3201/CSE4500 Information Retrieval Systems
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
WORKING WITH XSLT AND XPATH
1 XPath XPath became a W3C Recommendation 16. November 1999 XPath is a language for finding information in an XML document XPath is used to navigate through.
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
XPath Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Processing of structured documents Spring 2003, Part 7 Helena Ahonen-Myka.
XPath. Why XPath? Common syntax, semantics for [XSLT] [XPointer][XSLT] [XPointer] Used to address parts of an XML document Provides basic facilities for.
ECA 228 Internet/Intranet Design I XSLT Example. ECA 228 Internet/Intranet Design I 2 CSS Limitations cannot modify content cannot insert additional text.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
Extensible Stylesheet Language Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University XSL-FO XSLT.
XSLT part of XSL (Extensible Stylesheet Language) –includes also XPath and XSL Formatting Objects used to transform an XML document into: –another XML.
XSLT Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Lecture 11 XSL Transformations (part 1: Introduction)
IS432: Semi-Structured Data Dr. Azeddine Chikh. 6. XML Path (XPath)
August Chapter 6 - XPath & XPointer Learning XML by Erik T. Ray Slides were developed by Jack Davis College of Information Science and Technology.
XPath Aug ’10 – Dec ‘10. XPath   XML Path Language   Technology that allows to select a part or parts of an XML document to process   XPath was.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
XPath. XPath, the XML Path Language, is a query language for selecting nodes from an XML document. The XPath language is based on a tree representation.
More XML XPATH, XSLT CS 431 – February 23, 2005 Carl Lagoze – Cornell University.
 XSL – Extensible Style Sheet Language  XSLT – XSL Transformations › Used to transform XML documents to other formats,like HTML or other XML documents.
XP New Perspectives on XML, 2 nd Edition Tutorial 7 1 TUTORIAL 7 CREATING A COMPUTATIONAL STYLESHEET.
University of Nottingham School of Computer Science & Information Technology Introduction to XML 2. XSLT Tim Brailsford.
CSE3201/CSE4500 XPath. 2 XPath A locator for items in XML document. XPath expression gives direction of navigation.
XPath --XML Path Language Motivation of XPath Data Model and Data Types Node Types Location Steps Functions XPath 2.0 Additional Functionality and its.
XP 1 XSLT II Robin Burke ECT 360. XP 2 Homework #4 Forgot we hadn't covered "choose" becomes extra credit My books.xml didn't include descriptions.
XSLT: How Do We Use It? Nancy Hallberg Nikki Massaro Kauffman.
XSLT I Robin Burke ECT 360. Outline History / Terminology XSLT processing XSLT syntax XPath XSLT basics Lab.
1 The XPath Language. 2 XPath Expressions Flexible notation for navigating around trees A basic technology that is widely used uniqueness and scope in.
CITA 330 Section 5 XPath. XSL XSL (Extensible Stylesheet Language) is the standard language for writing stylesheets to transform XML documents among different.
5 Copyright © 2004, Oracle. All rights reserved. Navigating XML Documents by Using XPath.
XML Schema – XSLT Week 8 Web site:
1 XSL Transformations (XSLT). 2 XSLT XSLT is a language for transforming XML documents into XHTML documents or to other XML documents. XSLT uses XPath.
XML Notes taken from w3schools. What is XML? XML stands for EXtensible Markup Language. XML was designed to store and transport data. XML was designed.
Rendering XML Documents ©NIITeXtensible Markup Language/Lesson 5/Slide 1 of 46 Objectives In this session, you will learn to: * Define rendering * Identify.
CH 15 XSL Transformations 1. Objective What is XSL? Overview of XSL transformations Understanding XSL templates Computing the value of a node with xsl:value-of.
Querying and Transforming XML Data
More XML XML schema, XPATH, XSLT
Presentation transcript:

XSLT and XPath, by Dr. Khalil1 XSL, XSLT and XPath Dr. Awad Khalil Computer Science Department AUC

XSLT and XPath, by Dr. Khalil2 Content  What XSL and XSLT are  How XSLT differs from imperative programming languages, like JavaScript  What templates are, and how they are used  How to address the innards of an XML document using XPath

XSLT and XPath, by Dr. Khalil3 What is XSL? , as the name implies, is an XML-based language to create  Extensible Style sheet Language, as the name implies, is an XML-based language to create style sheets.  The successor to Extensible Stylesheet Language (XSL), is an XML-based language that enables you to transform one class of XML document to another.  The successor to Extensible Stylesheet Language (XSL), XSL Transformations (XSLT) is an XML-based language that enables you to transform one class of XML document to another.  XSLT offers tremendous flexibility for presenting and exchanging data between disparate devices and business systems. For example, with XSLT style sheets, you can dynamically transform an XML purchase order from one schema to another before sending the order to a supplier.  In addition, with XSLT you can dynamically transform an XML document so it can be rendered on a variety of Internet-enabled devices, including handheld PCs and TV set-top boxes.   XSLT is a powerful tool for e-commerce, as well as any other place where XML might be used.

XSLT and XPath, by Dr. Khalil4 XSLT Engine  An XSL engine uses style sheets to transform XML documents into other document types, and to format the output.  In these style sheets you define the layout of the output document, and where to get the data from within the input document.  In XML, the input document is called the, and the output document the.  In XML, the input document is called the source tree, and the output document the result tree.  There are actually two complete languages under the XSL umbrella:  A transformation language, which is named XSLT  A language used to describe XML documents for display, XSL Formatting Objects

XSLT and XPath, by Dr. Khalil5 How XSLT Works?  XSLT transforms XML documents into whatever other format – HTML for display on web sites, a different XML-based structure for other applications (such as storing data in a back-end databases), or even just regular text files.  XSLT relies on finding parts of an XML document that match a series of predefined templates, and then applying transformation and formatting rules to each matched part.  XPath – another language – is used to help finding and querying these matching parts.

XSLT and XPath, by Dr. Khalil6 What Do You Need?  In order to perform an XSLT transformation, you need at least three things: an to transform, an, and an  In order to perform an XSLT transformation, you need at least three things: an XML document to transform, an XSLT style sheet, and an XSLT engine.  The style sheet contains the instructions for the transformation you want to perform.  The engine is the software which will carry out the instructions in the style sheet

XSLT and XPath, by Dr. Khalil7 XSLT Engines   XT   It’s a Win32 executable program that you can download from:   You can run XT from the DOS command prompt, using the general syntax: C:\>XT source stylesheet result  MSXML  It’s XML parser that ships with IE 5 and also includes an XSLT engine. You can download the latest preview from: oads/webtechnology/xml/msx ml.asp

XSLT and XPath, by Dr. Khalil8 How Do XSLT Style Sheets Work?  XSLT style sheets are built on structures called templates.  A template specifies what to look for in the source tree, and what to put into the result tree.  XSLT is written in XML, meaning that there are special XSLT elements and attributes you use to create your style sheets: First tag found! First tag found!  Templates are defined using the XSLT element. There are two important pieces to this template: the match attribute, and the contents of the template.  The match attribute specifies a pattern in the source tree; this template will be applied for any nodes in the source tree that match that pattern – the element named first, in this case. If this template was included in a style sheet, every time the XSLT engine fount a element in the source tree, it would output the text “ First tag found! ”.  The contents of a template can be much more complex than simply outputting text. The element takes information from the source tree, and adds it to the result tree, for example:

XSLT and XPath, by Dr. Khalil9 Associating Style Sheets Using PIs  An XSL style sheet can be associated with an XML document using a style sheet processing instruction:

XSLT and XPath, by Dr. Khalil10 A Simple E-Commerce Application  Assume there are two companies working together, sharing information over the Internet. Company A is a store, which sends purchase orders to Company B, who fulfills those orders. Company A needs information on the salesperson who made the order for commissioning purposes, but Company B doesn’t need it, but instead needs to know the part numbers, which Company A ’s order doesn’t really care about. Company A John Doe Production-Class Widget Sally Finkelstien Company B 2000/1/13 Company A E16-25A Production-Class Widget 16

XSLT and XPath, by Dr. Khalil11 The E-Commerce Application – Different Scenarios  can use the same structure for their XML that uses. The disadvantage is that they now a separate XML document to accompany the first one, for their own additional information.  Company A can use the same structure for their XML that Company B uses. The disadvantage is that they now a separate XML document to accompany the first one, for their own additional information.  can use the same structure for their XML that uses.  Company B can use the same structure for their XML that Company A uses.  Both companies can use whatever XML format they wish internally, but transform their data to a common format whenever they need to transmit the information outside

XSLT and XPath, by Dr. Khalil12 1- Create Company A’s data (CompanyA.xml) John Doe Production-Class Widget Sally Finkelstien

XSLT and XPath, by Dr. Khalil13 2- Create the XSLT to contain the instructions for transformation (order.xsl) / /<xsl:value-of select="/order/date/month"/>/ select="/order/date/month"/>/ Company A Company A </xsl:template> E16-25A E16-25B 00

XSLT and XPath, by Dr. Khalil14 3- Perform the transformation (using XT engine) C:\>XT CompanyA.xml order.xsl CompanyB.xsl   The output of this transformation will be Company B ’s data: 2000/1/13 Company A 16 E16-25A Production-Class Widget 16

XSLT and XPath, by Dr. Khalil15 XPath  is a whole separate specification from W3C which is used for addressing and pointing to sections of an XML document, to allow to get the exact pieces of information we need.  XPath is a whole separate specification from W3C which is used for addressing and pointing to sections of an XML document, to allow to get the exact pieces of information we need.  uses extensively.  XSL uses XPath extensively.  We use to address XML documents by specifying a.  We use XPath expressions to address XML documents by specifying a location path.  XPath needs to know a ; that is, the section of the XML document from XPath should start navigation through the document.  XPath needs to know a context node ; that is, the section of the XML document from XPath should start navigation through the document.

XSLT and XPath, by Dr. Khalil16 Node? What’s a Node?  XPath uses the term to refer to any part of a document, whether it be element, attribute, or otherwise.  XPath uses the term node to refer to any part of a document, whether it be element, attribute, or otherwise.  are collections of nodes. Node-sets can contain any type of node.  Node-sets are collections of nodes. Node-sets can contain any type of node.  for example, if you tell XPath to look for any elements with an attribute, XPath will return a node-set, which will be a collection of all the elements in the source tree that have an attribute.  for example, if you tell XPath to look for any elements with an id attribute, XPath will return a node-set, which will be a collection of all the elements in the source tree that have an id attribute.

XSLT and XPath, by Dr. Khalil17 Location Paths  The first thing to note about XPath is the concept of the, which is not the  The first thing to note about XPath is the concept of the document root, which is not the root element.  Since there can be other things at the beginning or end of an XML document before or after the root element, hence, the acts as a virtual root of the document’s hierarchy.  Since there can be other things at the beginning or end of an XML document before or after the root element, hence, the document root acts as a virtual root of the document’s hierarchy.  Consider the example which has the following XML: John Fitzgerald Johanson Doe>

XSLT and XPath, by Dr. Khalil18 Location Paths (Cont’d)  In XPath, the document root is specified by a single “” as: for which XSLT applies to the entire document.  In XPath, the document root is specified by a single “ / ” as: for which XSLT applies to the entire document.  If we only wanted to match against the element in the order.xml file, instead of the entire document, we could write the XPath expression “ ”.  If we only wanted to match against the element in the order.xml file, instead of the entire document, we could write the XPath expression “ /order ”.  XPath reads expressions from left to right, so in this case it reads “start at the document node, and return the <> element which is a child of that node.  XPath reads expressions from left to right, so in this case it reads “start at the document node, and return the element which is a child of that node.  XPath expressions can be read backward as “select any elements named which are children of the document root”.

XSLT and XPath, by Dr. Khalil19 Location Paths (Cont’d)  XPath expressions can be relative, meaning that they start at the context node, or absolute, meaning that they start at the document root.  Additional steps in instructions to XPath are separated by additional “/” characters, for example, ” which means “select any elements named which are children of elements, which are children of elements, which are children of the document root.  Additional steps in instructions to XPath are separated by additional “/” characters, for example, “/order/item/part- number ” which means “select any elements named which are children of elements, which are children of elements, which are children of the document root.  XPath also allows using the symbol, for example, ” means “select the id attribute of the context node”.  XPath also allows using the symbol, for example, ” means “select the id attribute of the context node”.  The “” is called the recursive descent operator which locates nodes based on their names, regardless of their locations in the document, for example, ” selects any <> element in the document, and selects any id attribute in the document.  The “ // ” is called the recursive descent operator which locates nodes based on their names, regardless of their locations in the document, for example, “//customer ” selects any element in the document, and selects any id attribute in the

XSLT and XPath, by Dr. Khalil20 More Specific Location Paths  “” brackets are used as a filter on the node being selected, for example:  “ [ ] ” brackets are used as a filter on the node being selected, for example:  matches any element which is a child of the context node and which has a child element.  “order [customer]” matches any element which is a child of the context node and which has a child element.  matches any element which is a child of the context node and which has a attribute.  “order matches any element which is a child of the context node and which has a number attribute.  matches any element which is a child of the context node, and which has a child with a value of “Company A”.  “order[customer=‘Company A’]” matches any element which is a child of the context node, and which has a child with a value of “Company A”.  “ matches any element with a value of “Company A”.  “ customer [. = ‘Company A”] matches any element with a value of “Company A”.  says select any elements which have a child element named which in turn has an attribute with a value of “216A”.  “//order says select any elements which have a child element named, which in turn has an id attribute with a value of “216A”.

XSLT and XPath, by Dr. Khalil21 XPath Functions  – are used for working with nodes in general. They can return information about a node, or return specific types of nodes.  Node Functions – are used for working with nodes in general. They can return information about a node, or return specific types of nodes.  – used to get the name of a node, for example, the following template will output the name of every element that’s child of a element:  name() – used to get the name of a node, for example, the following template will output the name of every element that’s child of a element:  – returns the node itself.  node() – returns the node itself.  Processing-instruction() – returns processing instructions. For example, the following template returns the contents of any processing instructions in the document: And this one outputs the contents of any PIs in the document with a PITarget of AppName:

XSLT and XPath, by Dr. Khalil22 Node Functions (Cont’d)  – used to return comments. for example, the following template will output the text in any comment:  comment() – used to return comments. for example, the following template will output the text in any comment:  text() – returns the PCDATA content of a node, without the PCDATA of the node’s children, if any. For example, if we consider the following XML: This is some text. And this is some more text The following template: returns: This is some text. And this some more text But, the following template: returns: This is some text.

XSLT and XPath, by Dr. Khalil23 Positional Functions  – is used to get the node’s position in a node-set, in document-order. For example, if we consider the following XML:  position() – is used to get the node’s position in a node-set, in document-order. For example, if we consider the following XML: a b c The template: will match any element. The template: will match the second element. or: or: xsl:template match=“/nodes/node[2]”>  last() – returns the position of the last node in a node-set. For example, to create a template that matches against the last element, we would do the following:  count() – returns the number of nodes in a node-set. For example, to get the number of elements, we would do the following:

XSLT and XPath, by Dr. Khalil24 Numeric Functions  – converts PCDATA text to a numeric value. For example, if we have an element like this:  number() – converts PCDATA text to a numeric value. For example, if we have an element like this: 256 According to XPath, this element contains a string containing the characters “2”, “5”, and “6”. In order to to treat the PCDATA as a numeric value of 256, we would have to use the function According to XPath, this element contains a string containing the characters “2”, “5”, and “6”. In order to to treat the PCDATA as a numeric value of 256, we would have to use the function number(element).  sum() – is used to add together all of the numeric values in a node-set. For example, if we have the following XML: then: returns the sum of all the elements.

XSLT and XPath, by Dr. Khalil25 Boolean Functions  – simply evaluates an XPath expression to be true or false, using the following rules:  boolean() – simply evaluates an XPath expression to be true or false, using the following rules:  If the value is numeric, it’s considered false if it is 0, or the special NaN value, otherwise considered true.  If the value is a string, it is true if its length is longer than 0 characters.  If the value is a node-set, it is true it it’s not empty, otherwise it’s false.  Any other type of object is converted to a Boolean in a way which is dependent on the type of object.  not() – simply takes whatever the result and reverses it.  true() – always returns true.  false() – always returns false.

XSLT and XPath, by Dr. Khalil26 String Functions   string()   string-length()   concat()   contains()   starts-with()   substring()   substring-after()   substring-before()   translate()  concat(‘mystring’, ‘ ‘, ‘more string’)  contains(“This is s string”, “is a”)  contains(“This is s string”, “is A”)  starts-with(“This is a string”, “This”)  starts-with(“This is a string”, “a string”)  substring(“This is the main string”, 13)  substring(“This is the main string”, 13, 4)  substring-after(‘This is the main string’, ‘a’)  substring-before(‘This is the main string’, ‘a’)  translate(‘QLSM’, ‘ABCDEFGHIJKLMNOPQRSTUVWXYZ’, ‘ZYXWVUTSRQPONMLKJIHGFEDCBA’)  translate(‘John’, ‘abcdefghijklmnopqrstuvwxyz’, ‘ZYXWVUTSRQPONMLKJIHGFEDCBA’)  translate(‘This is a string’, ‘ ‘, ‘+’)  translate(‘+bat+’, ‘abc+ ‘, ‘ABC’) 

XSLT and XPath, by Dr. Khalil27 Axis Names  In XML, there are numerous directions we can travel, in addition to just moving up and down between parents and children.  The way that we move in these other directions is through different.  The way that we move in these other directions is through different axes.  There are 13 axes defined in XPath, which we use in XPath by specifying the axis name, followed by ::, followed by the node name.  From our node, we have access to parents and ancestors, children and descendents, and siblings.  If the node is an element, we have also access to attributes that are attached to that node.  The last section of the tree, we have access to the namespace.

XSLT and XPath, by Dr. Khalil28 Axis Names (Cont’d)  The simplest is the axis, which refers to the context node. The notation is a shortcut for  The simplest is the self axis, which refers to the context node. The “.” notation is a shortcut for self::node().  The axis is the default axis and contains the children of the context node. gives exactly the same meaning as  The child axis is the default axis and contains the children of the context node. “order” gives exactly the same meaning as “child::order”.  There are also wildcards available for child elements and child attributes: selects any child elements, and selects any child attributes:  There are also wildcards available for child elements and child attributes: “*” selects any child elements, and selects any child attributes:  Theaxis specifiesany children, or children of children, etc. of the current node, while axis contains the descendents of the context node, including itself. is the shortcut for, relative to the document root. is the axis of the context node. So, means the same as “  The descendant axis specifies any children, or children of children, etc. of the current node, while descendant-or-self axis contains the descendents of the context node, including itself. “//” is the shortcut for descendant-or-self, relative to the document root. “.//” is the descendant- or-self axis of the context node. So, “.//description” means the same as “ descendant-or-self::description”.

XSLT and XPath, by Dr. Khalil29 Axis Names (Cont’d)  The axis specifies the parent of the context node (if any), and the axis specifies the parent of the context node, or the parent’s parent, etc. The works the opposite way to the  The parent axis specifies the parent of the context node (if any), and the ancestor axis specifies the parent of the context node, or the parent’s parent, etc. The ancestor-or-self works the opposite way to the descendent-or- self.  The axis contains all of the following sibling elements of the context node, including their descendents (but not including descendents of the context node).  The following-sibling axis contains all of the following sibling elements of the context node, including their descendents (but not including descendents of the context node).  The axis contains all of the preceding elements of the node, including their descendents (but not including the ancestors of the context node).  The preceding-sibling axis contains all of the preceding elements of the node, including their descendents (but not including the ancestors of the context node).  The axis is used to get at the attributes of the context node.  The attribute axis is used to get at the attributes of the context node.  Theaxis selects the namespace nodes of the context node, if any.  The namespace axis selects the namespace nodes of the context node, if any.

XSLT and XPath, by Dr. Khalil30 An Example: order.xml 2000/1/1 Company A E16-25A Production-Class Widget 16 Xpath.xsl <xsl:stylesheet version="1.0" xmlns:xsl=" Transform">

XSLT and XPath, by Dr. Khalil31 Other XPath Expressions  selects any elements which are children of the context node.  child::orderorder selects any elements which are children of the context node. selects any elements which are child of. order/* selects any elements which are child of. selects any attributes which belong to. selects any attributes which belong to.  selects any elements which are a descendent of the context node, including the context node if applicable.  descendent-or-.//description selects any elements self:description which are a descendent of the context node, including the context node if applicable.  selects the number attribute of the node.  order/attribute::number selects the number attribute of the node.  selects any elements which are a  //date/parent::order//date/../order selects any elements which are a parent of a element.  selects any elements which are descendents of the element  /order/descendent::description selects any elements which are descendents of the element  selects a element, if that element is a sibling of a node, and it comes after the node in the document order.  //description/following-sibling::quantity selects a element, if that element is a sibling of a node, and it comes after the node in the document order.

XSLT and XPath, by Dr. Khalil32 Other XPath Expressions (Cont’d)  selects a element, if that element is a sibling of the node, and it comes before the node in document order.  //quantity/preceding-sibling::description selects a element, if that element is a sibling of the node, and it comes before the node in document order.  selects any elements which come after the element in the document, not including descendents.  /order/date/following::* selects any elements which come after the element in the document, not including descendents.  selects any elements which come before the element, not including ancestors.  /order/item/preceding::* selects any elements which come before the element, not including ancestors.

XSLT and XPath, by Dr. Khalil33 Thank you