SlideShare a Scribd company logo
1 of 18
XML QUERY LANGUAGE AND NAVIGATION
 XML sprang to life as a metalanguage that can be used to describe any sort of data and
documents using a truly hierarchical representation, or a representation that simply looks
hierarchical.
 In the Microsoft .NET Framework, XPath is fully supported through the classes defined in the
System.Xml.XPath namespace
 What Is Xpath ?
 XPath is a general-purpose query language for addressing and filtering both the elements and
the text of an XML document. As the name suggests, the XPath notation is basically
declarative. A valid XPath expression looks like a path to a particular set of nodes or a value
excerpted from the source document.
 XPath works on top of a tree-based representation of the source document.
 The path expresses a node pattern using a notation that emphasizes the hierarchical
relationship between the nodes.
 This expression states: find all the address nodes that happen to be children of the customer
element. But on which nodes is this expression evaluated? An Xpath expression is always
evaluated in the context of a node. The context node is designated by the application and
represents the starting point of the query. Expressing the concept of the context node in terms
of file system paths, we could say that the appropriate file system counterpart for the context
node is the current directory. The nodes affected by the expression form the context node-set.
The final set of nodes that is actually returned to the application is a subset of the context
node-set that includes only those nodes that match the specified criteria.
 Context of XPath Queries
 The context of an XPath query includes, but is not limited to, a context node and a context node-set. The
node-set. The XPath context also contains position and namespace information, variable bindings, and a
bindings, and a standard library of functions. We'll look at the contents of the XPath context in detail in
detail in this section.
 In the .NET Framework, the context node is the XmlNode object on which you call either the SelectNodes
A SAMPLE XML TREE IN WHICH THE NODE NUMBERS INDICATE THE ORDER IN WHICH NODES ARE VISITED BY THE
XPATH QUERY PROCESSOR.
 Position Information
 An XPath context is characterized by a position and a size. The position attribute is a one-based value
 XPath and Namespaces
 The XPath processor uses node information to determine whether a match exists with the current
current expression. The most important information used by XPath expressions is the node's name, type,
name, type, and attributes. XPath fully supports XML namespaces and splits the name of a node into two
node into two constituent parts: the namespace URI and the local name. The set of namespaces declared
namespaces declared in scope for the context node is used to qualify node names in the expression.
expression.
 Variable Bindings
 An XPath expression can contain variable references that are resolved through a set of in-memory
memory bindings established between variable names and actual values. Each variable holds a value
a value whose type is normally one of the four base types—node-set, string, Boolean, and number. It is
WHAT IS XPOINTER?
 XPointer is used to locate data within an XML document. When XML documents need to point
to external resources, they can declare an entity reference or, more effectively, include the
whole resource, using the XML Inclusion (XInclude) syntax. XInclude—a W3C recommendation
candidate—links the host document to an external resource, or a portion of it. XPointer defines
the syntax you use to specify the addressed portion of the document.
 Normally, to indicate a particular position in an XML document, you attach a fragment
identifier to the document's URL. A fragment identifier is marked by a number sign (#) and
follows the document's URL. For example, the URL http://www.w3.org/TR/xptr/#conformance
points to the portion of the document labeled with the conformance name. With XPointer, you
can use the XPath syntax to identify with greater flexibility a particular location in the external
document
 How XPointer Uses Xpath
 An XPointer fragment identifier can be the name of a particular portion of the target document, but it
XPATH IN THE XML DOM
 In the .NET Framework, you can make use of XPath expressions in two ways: through the XML DOM or
by means of a new and more flexible API based on the concept of the XPath navigator.
 In the former case, you use XPath expressions to select nodes within the context of a living instance of
the XmlDocument class.
THE XML DOM NODE RETRIEVAL API
 When using XPath queries to query an XML DOM instance, you can use the SelectNodes method of the
XmlDocument class. In particular, SelectNodes returns a collection that contains instances of all the
XmlNode objects that match the specified expression. If you don't need the entire node-set, but instead
plan to use the query to locate the root of a particular subtree, use the SelectSingleNode method.
 SelectSingleNode takes an XPath expression and returns a reference to the first match found.
 The XPathNavigator Class
 The programming interface of the navigator object is defined in the XPathNavigator abstract class. The
class. The XPathNavigator class represents a generic interface designed to act as a reader for any data
any data that exposes its contents as XML.
 Functionally speaking, the XPathNavigator class is not much different from a pseudoclass that simply
simply groups together all the XML DOM methods (ChildNodes, SelectNodes, and SelectSingleNode) to
XPATH NAVIGATORS AND XML READERS
 The MSDN documentation defines an XPath navigator as a class that reads data from an XML-based
data store using a cursor model. XPathNavigator, therefore, provides read-only, random access to the
underlying XML-based data.
 XPath navigators and XML readers are radically different objects, although both look like client-
side cursors for reading XML data. Let's review the key differences:
 Connection model
 Navigation interface
 Programming interface
THE RELATIONSHIP BETWEEN CALLERS, NAVIGATORS, AND
ITERATORS.
 On the long road to standardization, XPath seems like the first significant step toward a
universal query language to keep up with the universal protocol (HTTP), the universal data
description language (XML), and the universal remote procedure call protocol (SOAP).

More Related Content

What's hot

Manipulation strings in c++
Manipulation strings in c++Manipulation strings in c++
Manipulation strings in c++SeethaDinesh
 
Generics and collections in Java
Generics and collections in JavaGenerics and collections in Java
Generics and collections in JavaGurpreet singh
 
Abstract Class & Abstract Method in Core Java
Abstract Class & Abstract Method in Core JavaAbstract Class & Abstract Method in Core Java
Abstract Class & Abstract Method in Core JavaMOHIT AGARWAL
 
Inter thread communication
Inter thread communicationInter thread communication
Inter thread communicationsubash andey
 
java interface and packages
java interface and packagesjava interface and packages
java interface and packagesVINOTH R
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database DesignArchit Saxena
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational modelChirag vasava
 
Database connectivity to sql server asp.net
Database connectivity to sql server asp.netDatabase connectivity to sql server asp.net
Database connectivity to sql server asp.netHemant Sankhla
 
Database User and Administrator
Database User and AdministratorDatabase User and Administrator
Database User and AdministratorA. S. M. Shafi
 

What's hot (20)

Collections in-csharp
Collections in-csharpCollections in-csharp
Collections in-csharp
 
Active x control
Active x controlActive x control
Active x control
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
 
Manipulation strings in c++
Manipulation strings in c++Manipulation strings in c++
Manipulation strings in c++
 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
Generics and collections in Java
Generics and collections in JavaGenerics and collections in Java
Generics and collections in Java
 
Xml parsers
Xml parsersXml parsers
Xml parsers
 
Abstract Class & Abstract Method in Core Java
Abstract Class & Abstract Method in Core JavaAbstract Class & Abstract Method in Core Java
Abstract Class & Abstract Method in Core Java
 
C# Delegates
C# DelegatesC# Delegates
C# Delegates
 
Inter thread communication
Inter thread communicationInter thread communication
Inter thread communication
 
java interface and packages
java interface and packagesjava interface and packages
java interface and packages
 
Xml schema
Xml schemaXml schema
Xml schema
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
 
Lab2 ddl commands
Lab2 ddl commandsLab2 ddl commands
Lab2 ddl commands
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
 
PHP - Introduction to PHP Date and Time Functions
PHP -  Introduction to  PHP Date and Time FunctionsPHP -  Introduction to  PHP Date and Time Functions
PHP - Introduction to PHP Date and Time Functions
 
Advance oops concepts
Advance oops conceptsAdvance oops concepts
Advance oops concepts
 
Database connectivity to sql server asp.net
Database connectivity to sql server asp.netDatabase connectivity to sql server asp.net
Database connectivity to sql server asp.net
 
Database User and Administrator
Database User and AdministratorDatabase User and Administrator
Database User and Administrator
 
Java packages
Java packagesJava packages
Java packages
 

Similar to Xml query language and navigation

Similar to Xml query language and navigation (20)

XPATH_XSLT-1.pptx
XPATH_XSLT-1.pptxXPATH_XSLT-1.pptx
XPATH_XSLT-1.pptx
 
E05412327
E05412327E05412327
E05412327
 
Xpath.pdf
Xpath.pdfXpath.pdf
Xpath.pdf
 
Xpath presentation
Xpath presentationXpath presentation
Xpath presentation
 
Applied xml programming for microsoft 2
Applied xml programming for microsoft  2Applied xml programming for microsoft  2
Applied xml programming for microsoft 2
 
Xml representation oftextspecifications
Xml representation oftextspecificationsXml representation oftextspecifications
Xml representation oftextspecifications
 
Chapter 18
Chapter 18Chapter 18
Chapter 18
 
Applied xml programming for microsoft
Applied xml programming for microsoftApplied xml programming for microsoft
Applied xml programming for microsoft
 
Ijert semi 1
Ijert semi 1Ijert semi 1
Ijert semi 1
 
X FILES
X FILESX FILES
X FILES
 
Xml and Co.
Xml and Co.Xml and Co.
Xml and Co.
 
 
Xml session
Xml sessionXml session
Xml session
 
advDBMS_XML.pptx
advDBMS_XML.pptxadvDBMS_XML.pptx
advDBMS_XML.pptx
 
eXtensible Markup Language
eXtensible Markup LanguageeXtensible Markup Language
eXtensible Markup Language
 
Xml transformation language
Xml transformation languageXml transformation language
Xml transformation language
 
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
 
Selenium-Locators
Selenium-LocatorsSelenium-Locators
Selenium-Locators
 
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
 
Web data management (chapter-1)
Web data management (chapter-1)Web data management (chapter-1)
Web data management (chapter-1)
 

More from Raghu nath

Ftp (file transfer protocol)
Ftp (file transfer protocol)Ftp (file transfer protocol)
Ftp (file transfer protocol)Raghu nath
 
Javascript part1
Javascript part1Javascript part1
Javascript part1Raghu nath
 
Regular expressions
Regular expressionsRegular expressions
Regular expressionsRaghu nath
 
Selection sort
Selection sortSelection sort
Selection sortRaghu nath
 
Binary search
Binary search Binary search
Binary search Raghu nath
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)Raghu nath
 
Stemming algorithms
Stemming algorithmsStemming algorithms
Stemming algorithmsRaghu nath
 
Step by step guide to install dhcp role
Step by step guide to install dhcp roleStep by step guide to install dhcp role
Step by step guide to install dhcp roleRaghu nath
 
Network essentials chapter 4
Network essentials  chapter 4Network essentials  chapter 4
Network essentials chapter 4Raghu nath
 
Network essentials chapter 3
Network essentials  chapter 3Network essentials  chapter 3
Network essentials chapter 3Raghu nath
 
Network essentials chapter 2
Network essentials  chapter 2Network essentials  chapter 2
Network essentials chapter 2Raghu nath
 
Network essentials - chapter 1
Network essentials - chapter 1Network essentials - chapter 1
Network essentials - chapter 1Raghu nath
 
Python chapter 2
Python chapter 2Python chapter 2
Python chapter 2Raghu nath
 
python chapter 1
python chapter 1python chapter 1
python chapter 1Raghu nath
 
Linux Shell Scripting
Linux Shell ScriptingLinux Shell Scripting
Linux Shell ScriptingRaghu nath
 

More from Raghu nath (20)

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

Recently uploaded

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
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
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
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
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
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
 
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
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 

Recently uploaded (20)

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
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
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
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
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
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🔝
 
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
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 

Xml query language and navigation

  • 1. XML QUERY LANGUAGE AND NAVIGATION
  • 2.  XML sprang to life as a metalanguage that can be used to describe any sort of data and documents using a truly hierarchical representation, or a representation that simply looks hierarchical.  In the Microsoft .NET Framework, XPath is fully supported through the classes defined in the System.Xml.XPath namespace  What Is Xpath ?  XPath is a general-purpose query language for addressing and filtering both the elements and the text of an XML document. As the name suggests, the XPath notation is basically declarative. A valid XPath expression looks like a path to a particular set of nodes or a value excerpted from the source document.
  • 3.  XPath works on top of a tree-based representation of the source document.  The path expresses a node pattern using a notation that emphasizes the hierarchical relationship between the nodes.
  • 4.  This expression states: find all the address nodes that happen to be children of the customer element. But on which nodes is this expression evaluated? An Xpath expression is always evaluated in the context of a node. The context node is designated by the application and represents the starting point of the query. Expressing the concept of the context node in terms of file system paths, we could say that the appropriate file system counterpart for the context node is the current directory. The nodes affected by the expression form the context node-set. The final set of nodes that is actually returned to the application is a subset of the context node-set that includes only those nodes that match the specified criteria.
  • 5.  Context of XPath Queries  The context of an XPath query includes, but is not limited to, a context node and a context node-set. The node-set. The XPath context also contains position and namespace information, variable bindings, and a bindings, and a standard library of functions. We'll look at the contents of the XPath context in detail in detail in this section.  In the .NET Framework, the context node is the XmlNode object on which you call either the SelectNodes
  • 6. A SAMPLE XML TREE IN WHICH THE NODE NUMBERS INDICATE THE ORDER IN WHICH NODES ARE VISITED BY THE XPATH QUERY PROCESSOR.
  • 7.  Position Information  An XPath context is characterized by a position and a size. The position attribute is a one-based value
  • 8.  XPath and Namespaces  The XPath processor uses node information to determine whether a match exists with the current current expression. The most important information used by XPath expressions is the node's name, type, name, type, and attributes. XPath fully supports XML namespaces and splits the name of a node into two node into two constituent parts: the namespace URI and the local name. The set of namespaces declared namespaces declared in scope for the context node is used to qualify node names in the expression. expression.  Variable Bindings  An XPath expression can contain variable references that are resolved through a set of in-memory memory bindings established between variable names and actual values. Each variable holds a value a value whose type is normally one of the four base types—node-set, string, Boolean, and number. It is
  • 9. WHAT IS XPOINTER?  XPointer is used to locate data within an XML document. When XML documents need to point to external resources, they can declare an entity reference or, more effectively, include the whole resource, using the XML Inclusion (XInclude) syntax. XInclude—a W3C recommendation candidate—links the host document to an external resource, or a portion of it. XPointer defines the syntax you use to specify the addressed portion of the document.  Normally, to indicate a particular position in an XML document, you attach a fragment identifier to the document's URL. A fragment identifier is marked by a number sign (#) and follows the document's URL. For example, the URL http://www.w3.org/TR/xptr/#conformance points to the portion of the document labeled with the conformance name. With XPointer, you can use the XPath syntax to identify with greater flexibility a particular location in the external document
  • 10.  How XPointer Uses Xpath  An XPointer fragment identifier can be the name of a particular portion of the target document, but it
  • 11. XPATH IN THE XML DOM  In the .NET Framework, you can make use of XPath expressions in two ways: through the XML DOM or by means of a new and more flexible API based on the concept of the XPath navigator.  In the former case, you use XPath expressions to select nodes within the context of a living instance of the XmlDocument class.
  • 12. THE XML DOM NODE RETRIEVAL API  When using XPath queries to query an XML DOM instance, you can use the SelectNodes method of the XmlDocument class. In particular, SelectNodes returns a collection that contains instances of all the XmlNode objects that match the specified expression. If you don't need the entire node-set, but instead plan to use the query to locate the root of a particular subtree, use the SelectSingleNode method.  SelectSingleNode takes an XPath expression and returns a reference to the first match found.
  • 13.
  • 14.  The XPathNavigator Class  The programming interface of the navigator object is defined in the XPathNavigator abstract class. The class. The XPathNavigator class represents a generic interface designed to act as a reader for any data any data that exposes its contents as XML.  Functionally speaking, the XPathNavigator class is not much different from a pseudoclass that simply simply groups together all the XML DOM methods (ChildNodes, SelectNodes, and SelectSingleNode) to
  • 15. XPATH NAVIGATORS AND XML READERS  The MSDN documentation defines an XPath navigator as a class that reads data from an XML-based data store using a cursor model. XPathNavigator, therefore, provides read-only, random access to the underlying XML-based data.
  • 16.  XPath navigators and XML readers are radically different objects, although both look like client- side cursors for reading XML data. Let's review the key differences:  Connection model  Navigation interface  Programming interface
  • 17. THE RELATIONSHIP BETWEEN CALLERS, NAVIGATORS, AND ITERATORS.
  • 18.  On the long road to standardization, XPath seems like the first significant step toward a universal query language to keep up with the universal protocol (HTTP), the universal data description language (XML), and the universal remote procedure call protocol (SOAP).