This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Query on xml parsing using java

 
akshitha Akki
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any one tell me if there is way parse/validate xml contents with the java code?
for example one of the validation can be to check if all the tags are closed in the xml given for validation..
 
Mansukhdeep Thind
Ranch Hand
Posts: 1158
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Study the classes in javax.xml.parsers package. That should do it for you.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that there is a difference btween testing for well-formedness (which is what closing and properly matching tags is all about) and validation (which requires a schema of some kind to test the XML against). Start reading here: https://www.coderanch.com/how-to/java/XmlFaq
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic