IOException
{
SAXParser localParser = null;
if ( this.parser == null )
{
SAXParserFactory factory = SAXParserFactory.newInstance( );
factory.setNamespaceAware( true );
String isValidatingString = System.getProperty( "drools.schema.validating" );
if ( System.getProperty( "drools.schema.validating" ) != null )
{
this.isValidating = Boolean.getBoolean( "drools.schema.validating" );
}
if ( this.isValidating == true )
{
factory.setValidating( true );
try
{
localParser = factory.newSAXParser( );
}
catch ( ParserConfigurationException e )
{
throw new RuntimeException( e.getMessage( ) );
}
try
{
localParser.setProperty( JAXP_SCHEMA_LANGUAGE,
W3C_XML_SCHEMA );
}
catch ( SAXNotRecognizedException e )
{
boolean hideWarnings = Boolean.getBoolean( "drools.schema.hidewarnings" );
if ( !hideWarnings )
{
System.err.println( "Your SAX parser is not JAXP 1.2 compliant - turning off validation." );
}
localParser = null;
}
}
if ( localParser == null )
{
// not jaxp1.2 compliant so turn off validation
try
{
this.isValidating = false;
factory.setValidating( this.isValidating );
localParser = factory.newSAXParser( );
}
catch ( ParserConfigurationException e )
{
throw new RuntimeException( e.getMessage( ) );
}