[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xerces-j-user
Subject:    Re: Validating an existing DOM Tree
From:       Michael Glavassevich <mrglavas () ca ! ibm ! com>
Date:       2008-04-22 20:38:02
Message-ID: OF2734F8F2.E71AF1AD-ON85257433.00706E4A-85257433.00715197 () ca ! ibm ! com
[Download RAW message or body]

Hi Matthew,

Xerces 2.6.0 only had experimental support for DOM Level 3 which was only
exposed through a special beta package (i.e.
beta-dom3-Xerces-J-bin.2.6.0.zip) which you had to download separately. You
need at least Xerces 2.7.0 if you want something fully functional. I would
suggest using the latest release (2.9.1) as we've fixed many bugs related
to DOM Level 3 and schema validation in the last few years which you might
encounter in the older releases.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

KWyjibo <das.da.ist@nurfuerspam.de> wrote on 04/22/2008 11:47:20 AM:

> 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: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic