SlideShare a Scribd company logo
1 of 19
X-FILES
XPath
• The XML Path Language (XPath) is a
standard for creating expressions that can be
used to find specific pieces of information
within an XML document.
• XPath expressions are used by both XSLT (for
which XPath provides the core functionality)
and XPointer to locate a set of nodes.
• To understand how XPath works, it helps to
imagine an XML document as a tree of nodes
consisting of both elements and attributes.
XPath
• XPath expressions have the ability to locate nodes
based on the nodes’ type, name, or value or by the
relationship of the nodes to other nodes within the
XML document.
• In addition to being able to find nodes based on
these criteria, an XPath expression can also return
any of the following:
– A node set
– A Boolean value
– A string value
– A numeric value
Operators and Special Characters
Operators Special Characters Description
/ Selects the children from the node
set on the left side of this
character.
// Specifies that the matching node
set should be located at any level
within the XML document
Operators and Special
Characters
. Specifies the current context should be used
* A wildcard character that selects all elements
or attributes regardless of name
@ Selects an attribute
: Namespace separator
() Indicates a grouping within an XPath
expression
[expression] Indicates a filter expression
[n] Indicates that the node with the
specified index should be selected
+ Addition operator
- Subtraction operator
div Division operator
* Multiplication operator
XPath
• The priority for evaluating XPath expressions is as
follows:
1. Grouping
2. Filters
3. Path operations
XPath Syntax
• The XML Path Language provides a declarative
notation, termed a pattern, used to select the
desired set of nodes from XML documents.
• Each step is further comprised of three pieces:
– An axis
– A node test
– A predicate
XPath Syntax
• the basic syntax
axis::node test[predicate]
• Using this basic syntax and the XML document in
Listing 5.1, we could locate all the <c> nodes by
using the following XPath expression:
/a/b/child::*
• Alternatively, we could issue the following
abbreviated version of the preceding expression:
/a/b/c
Axes
• The axis portion of the location step identifies the
hierarchical relationship for the desired nodes from the
current context.
• Axis Description ancestor Specifies that the query
should locate the ancestors of the current context node,
which includes the parent node, the parent’s parent
node, and ultimately the root node.
• ancestor-or-self Indicates that in addition to the
ancestors of the current context node, the context node
should also be included in the resulting node set.
• attribute Specifies that the attributes of the current
context node are desired.
• child Specifies that the immediate children of the
current context node are desired.
• descendant Specifies that in addition to the
immediate children of the current context node, the
children’s children are also desired.
Sample1.xml Contains a Simple XML
Document
<a>
<b>
<c d=”Attrib 1”>Text 1</c>
<c d=”Attrib 2”>Text 2</c>
<c d=”Attrib 3”>Text 3</c>
</b>
<b>
<c d=”Attrib 4”>Text 4</c>
<c d=”Attrib 5”>Text 5</c>
</b>
<b>
<c d=”Attrib 6”>Text 6</c>
<c d=”Attrib 7”>Text 7</c>
<c d=”Attrib 8”>Text 8</c>
<c d=”Attrib 9”>Text 9</c>
</b>
<b>
<c d=”Attrib 10”>Text 10</c>
<c d=”Attrib 11”>Text 11</c>
<c d=”Attrib 12”>Text 12</c>
</b>
Node Tests
• The node test portion of a location step indicates
the type of node desired for the results.
• A node test may also contain a node name, or
QName.
Predicates
• The predicate portion of a location step filters a
node set on the specified axis to create a new node
set.
• Each node in the preliminary node set is evaluated
against the predicate to see whether it matches the
filter criteria.
• A predicate may consist of a filter condition that is
applied to an axis that either directs the condition
in a forward or reverse direction.
XPath Functions
• XPath functions are used to evaluate XPath
expressions and can be divided into one of four
main groups:
– Boolean
– Node set
– Number
– String
XPointer
• An XPointer uses location steps the same as XPath
but with two major differences:
• Because an Xpointer describes a location within an
external document, an XPointer can target a point
within that XML document or a range within the
target XML document.
Some XPointer Functions That
Return Location Sets
• Function Description
• id() Selects all nodes with the
specified ID
• root() Selects the root element as
the only location in a
location set
• here() Selects the current element
location in a location set
• origin() Selects the current element
location for a node using an
out-of-line link
Points
• Many times a link from one XML document into
another must locate a specific point within the
target document.
• XPointer points solve this problem for XML
developers by allowing a context node to be
specified and an index position indicating how far
from the context node the desired point is.
• Two different types of points can be represented
using XPointer points:
– Node points
– Character points
XLink
• The XML Linking Language, XLink, addresses and
overcomes these limitations by allowing a link to
another document to be specified on any element
within an XML document.
• The XML Linking Language creates a link to
another resource through the use of attributes
specified on elements, not through the actual
elements themselves.
XLink
• The xlink:type attribute must contain one of the
following values:
– simple
– extended
– locator
– arc
– resource
– title
– none

More Related Content

What's hot (20)

10. XML in DBMS
10. XML in DBMS10. XML in DBMS
10. XML in DBMS
 
DTD
DTDDTD
DTD
 
Ajax ppt
Ajax pptAjax ppt
Ajax ppt
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Xml parsers
Xml parsersXml parsers
Xml parsers
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
 
DOM and SAX
DOM and SAXDOM and SAX
DOM and SAX
 
Xml 215-presentation
Xml 215-presentationXml 215-presentation
Xml 215-presentation
 
File access methods.54
File access methods.54File access methods.54
File access methods.54
 
MULTI THREADING IN JAVA
MULTI THREADING IN JAVAMULTI THREADING IN JAVA
MULTI THREADING IN JAVA
 
Extensible Markup Language (XML)
Extensible Markup Language (XML)Extensible Markup Language (XML)
Extensible Markup Language (XML)
 
XSLT.ppt
XSLT.pptXSLT.ppt
XSLT.ppt
 
Servlets
ServletsServlets
Servlets
 
Cs8591 Computer Networks - UNIT V
Cs8591 Computer Networks - UNIT VCs8591 Computer Networks - UNIT V
Cs8591 Computer Networks - UNIT V
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
Python file handling
Python file handlingPython file handling
Python file handling
 
Unit ii java script and xhtml documents and dynamic documents with javascript
Unit ii java script and xhtml documents and dynamic documents with javascriptUnit ii java script and xhtml documents and dynamic documents with javascript
Unit ii java script and xhtml documents and dynamic documents with javascript
 
File Handling Python
File Handling PythonFile Handling Python
File Handling Python
 
Dtd
DtdDtd
Dtd
 
Query processing
Query processingQuery processing
Query processing
 

Similar to X FILES (20)

Xpath.pdf
Xpath.pdfXpath.pdf
Xpath.pdf
 
02_Xpath.pdf
02_Xpath.pdf02_Xpath.pdf
02_Xpath.pdf
 
XPATH
XPATHXPATH
XPATH
 
Xpath presentation
Xpath presentationXpath presentation
Xpath presentation
 
XML Technologies
XML TechnologiesXML Technologies
XML Technologies
 
Day2 xslt x_path_xquery
Day2 xslt x_path_xqueryDay2 xslt x_path_xquery
Day2 xslt x_path_xquery
 
Xpath
XpathXpath
Xpath
 
X path
X pathX path
X path
 
X path
X pathX path
X path
 
Xpath.ppt
Xpath.pptXpath.ppt
Xpath.ppt
 
03 x files
03 x files03 x files
03 x files
 
Xpath1
Xpath1Xpath1
Xpath1
 
Xml session
Xml sessionXml session
Xml session
 
Ch2 neworder
Ch2 neworderCh2 neworder
Ch2 neworder
 
Extracting data from xml
Extracting data from xmlExtracting data from xml
Extracting data from xml
 
Advance topics of C language
Advance  topics of C languageAdvance  topics of C language
Advance topics of C language
 
098ca session7 c++
098ca session7 c++098ca session7 c++
098ca session7 c++
 
XML(EXtensible Markup Language). XML(EXtensible Markup Language).pptppt
XML(EXtensible Markup Language). XML(EXtensible Markup Language).pptpptXML(EXtensible Markup Language). XML(EXtensible Markup Language).pptppt
XML(EXtensible Markup Language). XML(EXtensible Markup Language).pptppt
 
Xml and DTD's
Xml and DTD'sXml and DTD's
Xml and DTD's
 
XPATH_XSLT-1.pptx
XPATH_XSLT-1.pptxXPATH_XSLT-1.pptx
XPATH_XSLT-1.pptx
 

More from SaraswathiRamalingam

Georg scheutz - Charles babbage - Saraswathi Ramalingam
Georg scheutz - Charles babbage - Saraswathi RamalingamGeorg scheutz - Charles babbage - Saraswathi Ramalingam
Georg scheutz - Charles babbage - Saraswathi RamalingamSaraswathiRamalingam
 
Dennis ritchie - SARASWATHI RAMALINGAM
Dennis ritchie - SARASWATHI RAMALINGAMDennis ritchie - SARASWATHI RAMALINGAM
Dennis ritchie - SARASWATHI RAMALINGAMSaraswathiRamalingam
 
Arithmetic expression INFIX TO POSTFIX CONVERTION saraswathi ramalingam
Arithmetic expression INFIX TO POSTFIX CONVERTION saraswathi ramalingamArithmetic expression INFIX TO POSTFIX CONVERTION saraswathi ramalingam
Arithmetic expression INFIX TO POSTFIX CONVERTION saraswathi ramalingamSaraswathiRamalingam
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMSaraswathiRamalingam
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMSaraswathiRamalingam
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMSaraswathiRamalingam
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMSaraswathiRamalingam
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMSaraswathiRamalingam
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMSaraswathiRamalingam
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMSaraswathiRamalingam
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMSaraswathiRamalingam
 
LAB PROGRAMS SARASWATHI RAMALINGAM
LAB PROGRAMS SARASWATHI RAMALINGAMLAB PROGRAMS SARASWATHI RAMALINGAM
LAB PROGRAMS SARASWATHI RAMALINGAMSaraswathiRamalingam
 
C PROGRAMS - SARASWATHI RAMALINGAM
C PROGRAMS - SARASWATHI RAMALINGAMC PROGRAMS - SARASWATHI RAMALINGAM
C PROGRAMS - SARASWATHI RAMALINGAMSaraswathiRamalingam
 

More from SaraswathiRamalingam (20)

MACINTOSH
MACINTOSHMACINTOSH
MACINTOSH
 
XSL - XML STYLE SHEET
XSL - XML STYLE SHEETXSL - XML STYLE SHEET
XSL - XML STYLE SHEET
 
XML - SAX
XML - SAXXML - SAX
XML - SAX
 
DOM-XML
DOM-XMLDOM-XML
DOM-XML
 
XML SCHEMAS
XML SCHEMASXML SCHEMAS
XML SCHEMAS
 
XML
XMLXML
XML
 
XML DTD DOCUMENT TYPE DEFINITION
XML DTD DOCUMENT TYPE DEFINITIONXML DTD DOCUMENT TYPE DEFINITION
XML DTD DOCUMENT TYPE DEFINITION
 
Georg scheutz - Charles babbage - Saraswathi Ramalingam
Georg scheutz - Charles babbage - Saraswathi RamalingamGeorg scheutz - Charles babbage - Saraswathi Ramalingam
Georg scheutz - Charles babbage - Saraswathi Ramalingam
 
Dennis ritchie - SARASWATHI RAMALINGAM
Dennis ritchie - SARASWATHI RAMALINGAMDennis ritchie - SARASWATHI RAMALINGAM
Dennis ritchie - SARASWATHI RAMALINGAM
 
Arithmetic expression INFIX TO POSTFIX CONVERTION saraswathi ramalingam
Arithmetic expression INFIX TO POSTFIX CONVERTION saraswathi ramalingamArithmetic expression INFIX TO POSTFIX CONVERTION saraswathi ramalingam
Arithmetic expression INFIX TO POSTFIX CONVERTION saraswathi ramalingam
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
 
LAB PROGRAMS SARASWATHI RAMALINGAM
LAB PROGRAMS SARASWATHI RAMALINGAMLAB PROGRAMS SARASWATHI RAMALINGAM
LAB PROGRAMS SARASWATHI RAMALINGAM
 
C PROGRAMS - SARASWATHI RAMALINGAM
C PROGRAMS - SARASWATHI RAMALINGAMC PROGRAMS - SARASWATHI RAMALINGAM
C PROGRAMS - SARASWATHI RAMALINGAM
 

Recently uploaded

EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxAnaBeatriceAblay2
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 

Recently uploaded (20)

EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 

X FILES

  • 2. XPath • The XML Path Language (XPath) is a standard for creating expressions that can be used to find specific pieces of information within an XML document. • XPath expressions are used by both XSLT (for which XPath provides the core functionality) and XPointer to locate a set of nodes. • To understand how XPath works, it helps to imagine an XML document as a tree of nodes consisting of both elements and attributes.
  • 3. XPath • XPath expressions have the ability to locate nodes based on the nodes’ type, name, or value or by the relationship of the nodes to other nodes within the XML document. • In addition to being able to find nodes based on these criteria, an XPath expression can also return any of the following: – A node set – A Boolean value – A string value – A numeric value
  • 4. Operators and Special Characters Operators Special Characters Description / Selects the children from the node set on the left side of this character. // Specifies that the matching node set should be located at any level within the XML document
  • 5. Operators and Special Characters . Specifies the current context should be used * A wildcard character that selects all elements or attributes regardless of name @ Selects an attribute : Namespace separator () Indicates a grouping within an XPath expression [expression] Indicates a filter expression [n] Indicates that the node with the specified index should be selected + Addition operator - Subtraction operator div Division operator * Multiplication operator
  • 6. XPath • The priority for evaluating XPath expressions is as follows: 1. Grouping 2. Filters 3. Path operations
  • 7. XPath Syntax • The XML Path Language provides a declarative notation, termed a pattern, used to select the desired set of nodes from XML documents. • Each step is further comprised of three pieces: – An axis – A node test – A predicate
  • 8. XPath Syntax • the basic syntax axis::node test[predicate] • Using this basic syntax and the XML document in Listing 5.1, we could locate all the <c> nodes by using the following XPath expression: /a/b/child::* • Alternatively, we could issue the following abbreviated version of the preceding expression: /a/b/c
  • 9. Axes • The axis portion of the location step identifies the hierarchical relationship for the desired nodes from the current context. • Axis Description ancestor Specifies that the query should locate the ancestors of the current context node, which includes the parent node, the parent’s parent node, and ultimately the root node. • ancestor-or-self Indicates that in addition to the ancestors of the current context node, the context node should also be included in the resulting node set.
  • 10. • attribute Specifies that the attributes of the current context node are desired. • child Specifies that the immediate children of the current context node are desired. • descendant Specifies that in addition to the immediate children of the current context node, the children’s children are also desired.
  • 11. Sample1.xml Contains a Simple XML Document <a> <b> <c d=”Attrib 1”>Text 1</c> <c d=”Attrib 2”>Text 2</c> <c d=”Attrib 3”>Text 3</c> </b> <b> <c d=”Attrib 4”>Text 4</c> <c d=”Attrib 5”>Text 5</c> </b> <b> <c d=”Attrib 6”>Text 6</c> <c d=”Attrib 7”>Text 7</c> <c d=”Attrib 8”>Text 8</c> <c d=”Attrib 9”>Text 9</c> </b> <b> <c d=”Attrib 10”>Text 10</c> <c d=”Attrib 11”>Text 11</c> <c d=”Attrib 12”>Text 12</c> </b>
  • 12. Node Tests • The node test portion of a location step indicates the type of node desired for the results. • A node test may also contain a node name, or QName.
  • 13. Predicates • The predicate portion of a location step filters a node set on the specified axis to create a new node set. • Each node in the preliminary node set is evaluated against the predicate to see whether it matches the filter criteria. • A predicate may consist of a filter condition that is applied to an axis that either directs the condition in a forward or reverse direction.
  • 14. XPath Functions • XPath functions are used to evaluate XPath expressions and can be divided into one of four main groups: – Boolean – Node set – Number – String
  • 15. XPointer • An XPointer uses location steps the same as XPath but with two major differences: • Because an Xpointer describes a location within an external document, an XPointer can target a point within that XML document or a range within the target XML document.
  • 16. Some XPointer Functions That Return Location Sets • Function Description • id() Selects all nodes with the specified ID • root() Selects the root element as the only location in a location set • here() Selects the current element location in a location set • origin() Selects the current element location for a node using an out-of-line link
  • 17. Points • Many times a link from one XML document into another must locate a specific point within the target document. • XPointer points solve this problem for XML developers by allowing a context node to be specified and an index position indicating how far from the context node the desired point is. • Two different types of points can be represented using XPointer points: – Node points – Character points
  • 18. XLink • The XML Linking Language, XLink, addresses and overcomes these limitations by allowing a link to another document to be specified on any element within an XML document. • The XML Linking Language creates a link to another resource through the use of attributes specified on elements, not through the actual elements themselves.
  • 19. XLink • The xlink:type attribute must contain one of the following values: – simple – extended – locator – arc – resource – title – none