How to use Location path expression in XPath Axes using Xml

In this article I will explain how to use the Location path expression in XPath.
  • 1767

Introduction

The location steps have specified the exact number of nodes or nodes in the path. They can also used the wildcards to specify the unknown nodes. The location path can be absolute or relative. An absolute location path can be start with the slash "/" whereas the relative path does not. The location path consists of one or many steps in both the relative as well as absolute path, each separated by the sign of slash "/".

Example

Absolute Path

/node1/node2/node3/.....

/node1/node2/node3/*

Relative Path

node1/node2/node3/..........

node1/node2/node3/*

This is used in XPath Axis, like,

child::*/child::name  That means select all the name grandchildren of the current node.

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.