Schema not working

I am using a schema to validate the an XML file with Xerces2.00 beta2

Even after setting my features to see the Schema it won't validate it. I am
also using a DTD to validate as well.
Maybe it is a conflict of interest, and can't see both the Schema and DTD??

here is my java code:

  // Instantiate a parser
            XMLReader parser =
                XMLReaderFactory.createXMLReader(
                    "org.apache.xerces.parsers.SAXParser");

            // Register the content handler
            parser.setContentHandler(contentHandler);

            // Register the error handler
            parser.setErrorHandler(errorHandler);

            // Turn on validation

            parser.setFeature( "http://xml.org/sax/features/validation",
                                                    true);

parser.setFeature("http://apache.org/xml/features/validation/schema",
                              true);

            parser.setFeature("http://xml.org/sax/features/namespaces",
                              false);

//parser.setFeature("http://apache.org/xml/features/continue-after-fatal-err
or", true);

            // Parse the document
            parser.parse(uri);



And the first like of my XMl doc seems correct as it is :

<?xml version="1.0" encoding="UTF-8"?>
<!-- by Brian Miles (Prowerk) -->
<!DOCTYPE acl SYSTEM "acl.dtd">
<acl aclPath="/olap/acl" repository="/olap/system/olap_rep"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="aclSchema.xsd">

I have even tried setting properties to allow schema, but got errors.
I am not getting any errors, but I am not being alerted when my xml is not
valid according to the schema.

Please Help!!

Thanks,



Brian Miles

Received on Sunday, 21 October 2001 16:04:37 UTC