I want to validate XML documents with schemas via SAX
I have problems when asigning an *.xsd file to *.xml document
My code:
<p:user xmlns:p="http://www.google.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.wsf.net user.xsd">
It works in my computer but don't in others.
The SAX parser fails to recognize that user.xsd is located in the same folder as XMl document.
So I decided to assign the schema document programmatically:
static final String = JAXP_SCHEMA_SOURCE =
"http://java.sun.com/xml/jaxp/properties/schemaSource";
theParser.setProperty(JAXP_SCHEMA_SOURCE, new File(...some *.xsd file full path));
But this has thrown NotRecognizedException.
any ideas?
thanks