How to use Predicates in XPath Axes using Xml

In this article I will explain how to use the Predicate term in XPath axes.
  • 1658

Introduction

A location path consists of an axis, a node test, and optionally, one or more predicates. In this article I explain the predicate term used in Axes. The syntax is as follow,

AxisName :: Node_Test [predicates]

Hear predicate is optional term. In my previous article I will explain the Name of axis and the Node Test now in this we see the predicate.

An XPath predicate allows us to write very specific rules about the nodes that we like to select when making our expressions. There are different types of expressions that we can use in your predicates. Some of them are:

  • Node Set
  • Boolean
  • Number
  • String
  • Result tree fragment

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.