SlideShare ist ein Scribd-Unternehmen logo
1 von 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).

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Dynamic Web
Dynamic WebDynamic Web
Dynamic Web
 
Active browser web page
Active browser web pageActive browser web page
Active browser web page
 
Xpath presentation
Xpath presentationXpath presentation
Xpath presentation
 
DOM and SAX
DOM and SAXDOM and SAX
DOM and SAX
 
Web search Technologies
Web search TechnologiesWeb search Technologies
Web search Technologies
 
Xml schema
Xml schemaXml schema
Xml schema
 
jQuery Ajax
jQuery AjaxjQuery Ajax
jQuery Ajax
 
Software Engineering for Web Applications
Software Engineering for Web ApplicationsSoftware Engineering for Web Applications
Software Engineering for Web Applications
 
WSDL
WSDLWSDL
WSDL
 
Ajax and Jquery
Ajax and JqueryAjax and Jquery
Ajax and Jquery
 
Controls in asp.net
Controls in asp.netControls in asp.net
Controls in asp.net
 
Ajax Ppt 1
Ajax Ppt 1Ajax Ppt 1
Ajax Ppt 1
 
Dynamic HTML (DHTML)
Dynamic HTML (DHTML)Dynamic HTML (DHTML)
Dynamic HTML (DHTML)
 
Advanced mechanisms for dynamic content delivery
Advanced mechanisms for dynamic content deliveryAdvanced mechanisms for dynamic content delivery
Advanced mechanisms for dynamic content delivery
 
Xml web services
Xml web servicesXml web services
Xml web services
 
Unit 1 introduction to web programming
Unit 1 introduction to web programmingUnit 1 introduction to web programming
Unit 1 introduction to web programming
 
Asp.net
Asp.netAsp.net
Asp.net
 
XSLT
XSLTXSLT
XSLT
 
HTTP request and response
HTTP request and responseHTTP request and response
HTTP request and response
 
recursive transition_networks
recursive transition_networksrecursive transition_networks
recursive transition_networks
 

Ähnlich wie Xml query language and navigation

Ähnlich wie 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
 
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)
 
Oracle soa xml faq
Oracle soa xml faqOracle soa xml faq
Oracle soa xml faq
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 

Kürzlich hochgeladen (20)

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 

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).