aspose file tools*
The moose likes I/O and Streams and the fly likes Validate XML from a string instead of a file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Validate XML from a string instead of a file?" Watch "Validate XML from a string instead of a file?" New topic
Author

Validate XML from a string instead of a file?

john nutter
Greenhorn

Joined: Feb 09, 2010
Posts: 1
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

Joined: Feb 09, 2010
Posts: 7
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
Bartender

Joined: Oct 14, 2005
Posts: 18155
    
    8

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

Joined: Jan 13, 2010
Posts: 18

You can try this:


i think that xerces is requeried
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validate XML from a string instead of a file?
 
Similar Threads
XML validation against XSD
how to validate xml document with xml schema in netbean and how to create simpleType in Netbean
How look at DOM element in XML (with backing Schema) and determine it's type, etc?
XML Schema Help
validating xml with xsd