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.
In this example we have created an XML file "persons.xml"
as in our previous section, which is necessary to execute XPath query on
to it. This "persons.xml" contains information related to name,
age, gender of different persons.
Here is the full source code for persons.xml file
as follows :
Now we have declared a class XPathChildAxis and
in this class we are parsing the XML file with JAXP. First of all we need
to load the document into DOM Document object. We have put that
persons.xml file in that current working directory.