File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to read XML tags using DOMparser in JAVA

 
mallika mallikaa
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 445
1
Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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

 
Haina Minawa
Ranch Hand
Posts: 119
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following code may help you. Try to understand it.

 
Naren Mane
Greenhorn
Posts: 16
Android Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic