• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sax validation against a two file schema

 
spaccount no
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I'm trying to validate xml files against a two file schema.
Everything works fine with the following code:


Here, the ROC xsd file internally points to another file called ROC_Schema1.xsd. This second file is placed in the same folder as ROC.xsd.


So now, I want to make this code generic and accept an inputstream instead of the exact file location.
Question, how do I do that. When I try to pass the stream I get an error. Details below:




The inputstream is being created in main() as follows:



I get the following warning:
Warning:org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'ROC_Schema1.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.

This naturally leads to issues during validation. I understand, that the stream doesn't contain the second xsd file. So how do I fix this?

Thanks,
Spaccount

 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"spaccount no", please check your private messages regarding an important administrative matter.

Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic