Greetings to all

I am currently trying to validate a document against a specific Schema,
regardless of any DTD or schema specified in the document.  Apparently this
is possible by setting the property
'http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation'
(according to http://xml.apache.org/xerces-j/properties.html).

Unfortunately, setting this property raises a SAXNotRecoginisedException
with the following stack:

org.xml.sax.SAXNotRecognizedException:
http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation
        at
org.apache.xerces.framework.XMLParser.setProperty(XMLParser.java:1534)
        at
org.apache.xerces.parsers.DOMParser.setProperty(DOMParser.java:821)
        at
com.onsea.test.schema.SchemaValidate.validate1(SchemaValidate.java:87)
        at com.onsea.test.schema.SchemaValidate.main(SchemaValidate.java:50)

My code is as follows:

DOMParser parser = new DOMParser();

try
{
  parser.setFeature( "http://xml.org/sax/features/validation";,
                     true );
  parser.setFeature( "http://apache.org/xml/features/validation/schema";,
                     true );
  parser.setProperty(
"http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation";
,
                      "test.xsd" );
}

catch ( SAXException e )
{
  e.printStackTrace();

  System.exit( 1 );
}

Any help would be greatly appreciated.

Many thanks

Cliff Rowley


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to