This tutorial explains the use of the getParent() and getQualifiedName(). These methods are present in the Attribute class. The Attribute class is available part of JDOM library.
Example discussed in this section explains the use of getPatent() and getQualifiedName() methods. After reading the examples you will be able to apply the logic to use correctly in your program.
The getChild(java.lang.String name)
method of Element class returns the child element.
The getParent() method of
Attribute class returns parent of the associated attribute.
The getQualifiedName() method of Attribute class returns name of attribute.
We will be using the following XML file.
book.xml
<?xml version="1.0" encoding="UTF-8"?>
|
AddAttributeList.java
package roseindia;
|
|
Child Name of root: [Element: <book/>]
Parent of attribute : [Element: <book/>] Name of attribute : id |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.