How to use Node Test in XPath Axes using Xml

In this article I will explain how to use the Node Test in XPath axes.
  • 1969

Introduction

In my previous article I will explain the axis syntax ,In which we use the Node Test. In this article I will explain how to use the Node Test and why. Node test is part of an expression that is used to retrieve one or more nodes. The syntax is,

AxisName :: Node_Test [predicates]

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

Example

child :: title

Hear title is the node_test, In addition to this, ( wildcards, name of the node)  the node_test can be one of the following

  • comment()  :  It is used to selects nodes that are comments.
  • node()  :   It is used to selects nodes of any type.
  • processing-instruction()  :   It is used to selects nodes that are processing instructions. We can specify which processing instruction to select by providing it's name in the parentheses.
  • text()  :   It is used to selects a text 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.