Hey, I'm designing a servlet that takes uploaded XML and XSD files and validates them using Xerces. The problem I have is that my XML and XSD files are stored as Strings (this is unavoidable). I can give the parser the XML file easily enough using:
parser.parse( new InputSource( new StringReader( xml ) ) ); However, setting the XSD schema file is not as easy. It doesn't seem to support the InputSource type as the value of the setProperty method. I have also tried using a ByteArrayInputStream: parser.setProperty( "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation", new ByteArrayInputStream( xsd.getBytes() ) ); As well as converting the string into a StreamSource and then into a Schema object from the StreamSource, which also throws class cast exceptions... Any help would be greatly appretiated. Thanks for your time, -Ross -- View this message in context: http://www.nabble.com/Validating-XML-with-XSD-schema-in-memory-as-String-tp16723765p16723765.html Sent from the Xerces - J - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]