This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Unable to read XML tags using DOMparser in JAVA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Unable to read XML tags using DOMparser in JAVA" Watch "Unable to read XML tags using DOMparser in JAVA" New topic
Author

Unable to read XML tags using DOMparser in JAVA

mallika mallikaa
Greenhorn

Joined: Nov 01, 2011
Posts: 6
Hi All,

Thanks for replying for previous questions.

How can we read XML file using DOM parser in java.We have already searched in Google but we are unable to find the solution.please provide me the solution .


we are able to read below example

<staff>
<firstname>yong</firstname>
<lastname>mook kim</lastname>
<nickname>mkyong</nickname>
<salary>100000</salary>
</staff>

WE ARE Unable to Read the below XML TAG

for example :
<ReportItem port="21" svc_name="ftp" protocol="tcp" severity="0" pluginID="0" pluginName="" pluginFamily="" />
<ReportItem port="22" svc_name="ssh" protocol="tcp" severity="0" pluginID="0" pluginName="" pluginFamily="" />
<ReportItem port="7938" svc_name="unknown" protocol="tcp" severity="0" pluginID="0" pluginName="" pluginFamily="" />


please provide us to solution.we are trying alot




Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1


What have you tried and what is not working? What Errors/Exceptions?

Haina Minawa
Ranch Hand

Joined: Oct 13, 2011
Posts: 119
The following code may help you. Try to understand it.

Naren Mane
Greenhorn

Joined: Mar 02, 2011
Posts: 16

Hi ,

Here is a piece of code to parse attribute values. This code is written using JDOM parser. Hope it helps.
Please note that code is written considering example provided by you.




Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to read XML tags using DOMparser in JAVA
 
Similar Threads
Problem in parsing an XML tag.
code to read the xml and also overide the value of certain attributes in xml at runtime itself
Search using Hibernate criteria querry
Designing Around UNIX File /etc/services
XML file parsing in Java using SAX