XPath Tutorials Posted on: June 11, 2009 at 12:00 AM
In this example we have created an XML file "person.xml" first, which is necessary to execute XPath query on to it.
XPath Tutorials
Java - XPath Tutorial In this example we have created an XML file "person.xml"
first, which is necessary to execute XPath query on to it. This "persons.xml"
contains information related to name, age, gender of different persons.
Use of count() function in XPath In the previous section of XPath in Java
tutorial we have studied about how to run XPath query in java and in this
section we are going to see how we can implement count() function in the
XPath query.
Use of name() function in XPath In the previous section of XPath in Java
tutorial we have studied about how to use count() function in XPath
query and in our this section we are going to see how we can implement name()
function in the XPath query.
Use of string-length() function in XPath In this section we will discuss about string-length()
function in XPath. string-length() function returns the number of character
in a string and you can use "=","<" and
">" for comparing two numbers.
Use of "|" separator for selecting
more than one path You can execute multiple expressions on an XML
file with the use of XPath"|" separator. It allows you
more flexibility by allowing you to execute multiple expressions at a time.
Use of @ for attribute in XPath In the previous section of XPath tutorial we have
studied how to show all elements of an XML file. In this section we are
describing you the use of @ for attribute in the XPath query. The
"@" selects attribute.
Using child axis in XPath expression
In this section you will know about the use of
"child axis". "child axis" consists of the children of
context node. It can be omitted as well because it is the default axis you may
or may not use it.
Use of "parent" in XPath expression In our previous section of tutorials you have studied
how to use child axis in XPath expression . Now this section will describe
the use of "parent" axis. "parent" axis consists of
parent of the context node.
Use of "descendant" in XPath expression In this section of XPath in Java tutorial you will
learn use of descendant in XPath expression. "descendant" will
select descendant elements of the context element node. "descendant"
are child or sub-child of a child element.
Use of "ancestor" in XPath Expression
As you learned about descendant axis in XPath
expression in the previous example, this section will illustrate the use
of ancestor in XPath expression. "ancestor" selects
parent element or ancestor of the context node and super-parent of that parent.
Use of "following" in XPath
In this section you will learn how to use "following"
in your XPath expression. "following" axis in XPath
expression will select each and every node or element following this current
node closing point.
Use of "preceding" axis in XPath expression In this part of tutorial we are going to describe you
the use of "preceding" axis in XPath expression. "preceding"
axis will select each and every element or node before the given context
node.
Using following-sibling in XPath In this part of tutorial we are going to describe you
how one can use "following-sibling" axis in to the XPath
expression. "following-sibling" has some other working rather
than "following" axis because it selects all siblings following
the
context node.
Use of preceding-sibling in XPath In the previous sections of XPath tutorials you
must have well studied about preceding, following-sibling axes.
Now in this tutorial you are going to be familiar with one more axis,
"preceding-sibling". "preceding-sibling" will select all
the sibling elements before the context node.
Ask Questions? Discuss: XPath Tutorials
Post your Comment