Hi there,

i've been trying to validate an existing Document object against an external
schema, but I always end up in an java.lang.AbstractMethodError when trying
to call the getDomConfig() method.

The function looks like this:

        public static void validateDocument(Document inputDocument, boolean
validating, String schema) throws SAXParseException {

                DOMConfiguration config = inputDocument.getDomConfig();
                config.setParameter("check-character-normalization", true);
                config.setParameter("error-handler", new XMLErrorHandler());
                config.setParameter("normalize-characters", true);
                
                if (validating == true) {
                        config.setParameter("schema-type",
"http://www.w3.org/2001/XMLSchema-instance";);
                        config.setParameter("schema-location", schema);
                        config.setParameter("validate", true);
                }
                
                inputDocument.normalizeDocument();
                
        }

The Java output:

Exception in thread "main" java.lang.AbstractMethodError:
org.apache.xerces.dom.DeferredDocumentImpl.getDomConfig()Lorg/w3c/dom/DOMConfiguration;
        at game.XMLManager.validateDocument(XMLManager.java:85)
        at game.XMLManager.main(XMLManager.java:116)

I know that this error occurs, when calling an abstract method. But I can't
imagine how I should get around this.

I know the Xerces api examples, but they don't really help, because the
Document is built from an URI using a LSParser Object.

By the way, I'm using Xerces 2.6.0.

Greetings,

Matthew
-- 
View this message in context: 
http://www.nabble.com/Validating-an-existing-DOM-Tree-tp16824760p16824760.html
Sent from the Xerces - J - Users mailing list archive at Nabble.com.


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

Reply via email to