We accomplish it this way:
class MyEntityResolver implements org.xml.sax.EntityResolver {
public org.xml.sax.InputSource resolveEntity(String publicId,
String systemId)
throws org.xml.sax.SAXException,
java.io.IOException
{
if (<override>) {
return new
org.xml.sax.InputSource(PATH_TO_OVERRIDING_SCHEMA);
}
else
{
// use the default behaviour
return null;
}
}
};
Then in your application:
xmlreader.setEntityResolver(new MyEntityResolver());
Cheers,
Jeff Bullock
jeff_bullock@xxxxxxxxxxx
-----Original Message-----
From: twcrone@xxxxxxxxxxxxx [mailto:twcrone@xxxxxxxxxxxxx]
Sent: Thursday, November 17, 2005 11:54 AM
To: users@xxxxxxxxxx
Subject: [cinjug-users] XML Schema validation
I know that you set the following features to have a Xerces XML parser
to
validate a document versus a schema...
parser.setFeature
( "http://xml.org/sax/features/validation", true );
parser.setFeature(
"http://apache.org/xml/features/validation/schema", true
);
But that only validates against the schema declared in the actual
document.
How do I override the one declared and have it validate against a schema
that
I specify?
--
twcrone@xxxxxxxxxxxxx
859-278-9634
---------
You may unsubscribe from this mailing list
by sending a blank email addressed to: users-unsubscribe@xxxxxxxxxx
--
Find additional help by sending a blank email
addressed to:
users-help@xxxxxxxxxx
|