• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Validate XML from a string instead of a file?

 
john nutter
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have XML that is saved in the java string format, and I need to validate it against an XSD file. I know how to do it using an XML FILE + XSD file, but how is it done with a String and an XSD file? thanks for the help
 
Baski Reddy
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure what parse you want to use. But all the XML parsers API's will support "string" type as well. Below is just an example. You need to look at the API of the parser of you are using.


 
Paul Clapham
Sheriff
Posts: 20995
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually that's an example of how to parse XML from a file. To parse from a string using that same parser:
 
Ernesto Chicas
Greenhorn
Posts: 18
Debian Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can try this:


i think that xerces is requeried
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic