This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

validating data in varibale possible????

 
Sandeep Jain
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I am collecting the data in a servlet from the front end ie: the form in html. Now I have to generate the xml part .So what I have done is generated the entire XML in a string variable. Kindly note data is stored in a variable and not in a file. Now I have to validate this data How do I do it.
Correct me if my approach is wrong.

------------------
Sandeep Jain
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are building the XML as a String and you need to validate the XML right?
Many parsers accept either a File or an InputStream as input. So you could build an instance of java.io.StringBufferInputStream with your string and pass it on to the parser.
Good luck,

------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic