[jdom-interest] Schema validation using Beta 6

Larry Davies Larry_Davies at notes.compaid.com
Fri May 4 12:54:52 PDT 2001


Actually, I have tried Xerces 1.3.0 and I get a totally different error.  The
error I get is:

java.lang.NoSuchMethodError: org.w3c.dom.Document: method
createElementNS(Ljava/lang/String;Ljava/lang/String;)Lorg/w3c/dom/Element; not
found
        at org.apache.xerces.parsers.DOMParser.startElement(DOMParser.java,
Compiled Code)
        at
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java,

Compiled Code)
        at
org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java,

Compiled Code)
        at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java,

Compiled Code)
        at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java,

Compiled Code)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:952)
        at
org.apache.xerces.validators.common.XMLValidator.resolveSchemaGrammar(XMLValidator.java:2437)

        at
org.apache.xerces.validators.common.XMLValidator.bindNamespacesToElementAndAttributes(XMLValidator.java,

Compiled Code)
        at
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java,

Compiled Code)
        at
org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java,

Compiled Code)
        at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java,

Compiled Code)
        at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java,

Compiled Code)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:952)
        at org.jdom.input.SAXBuilder.build(SAXBuilder.java, Compiled Code)
        at org.jdom.input.SAXBuilder.build(SAXBuilder.java:464)
.
.
.

I am pretty sure I tried this as well using 1.3.1 and I got the same error as
above.  I thought I read somewhere that it is important that if you are using
JDOM that
you should use the version of Xerces that comes with it.

Thanks,
Larry




Paul Jakubik <pauljakubik at yahoo.com> on 05/04/2001 01:44:56 PM

To:   Larry Davies/CAICORP at CAICORP, jdom-interest at jdom.org
cc:

Subject:  Re: [jdom-interest] Schema validation using Beta 6



Give Xerces 1.3.1 a try. There are a lot of schema
improvements in it. Xerces 1.4 should be even better,
but unfortunately it is not out yet.

--Paul


--- Larry Davies <Larry_Davies at notes.compaid.com>
wrote:
> I have seen a number of postings regarding schema
> validation but it appears as
> though nobody has answered the following issue:
> "Grammar with uri ...".
>   I am validating an xml document against a schema.
> I am invoking validation by
> calling SAXBuilder builder = new SAXBuilder(true).
>
> My XML document reference to my schema is:
> <Data xmlns="http://localhost"
>
>
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
>              xsi:schemaLocation="http://localhost
> mySchema.xsd">
>
> My schema has a declaration like:
> <schema xmlns="http://www.w3.org/2000/10/XMLSchema"
>         xmlns:cs="http://localhost"
>         elementFormDefault="qualified"
>         attributeFormDefault="unqualified"
>         targetNamespace="http://localhost">
>
> I have verified that these documents are valid,
> since I validated them using XML
>  Spy.
>
> When I run my app, using JDOM Beta 6 and Xerces
> 1.2.0 ( I am positive that I am
> using these two and not another one) I get the
> following error:
>
> org.jdom.JDOMException: Error on line 2 of document
> file:ProductData.xml:
> General Schema Error: Grammar with uri :
> http://localhost , can not found.
>         at
> org.jdom.input.SAXBuilder.build(SAXBuilder.java,
> Compiled Code)
>         at
> org.jdom.input.SAXBuilder.build(SAXBuilder.java:464)
> .
> .
> .
> Root cause: org.xml.sax.SAXParseException: General
> Schema Error: Grammar with
> uri : http://localhost , can not found.
>         at
>
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1008)
>         at
>
org.apache.xerces.validators.common.XMLValidator.validateElementAndAttributes(XMLValidator.java,

>
> Compiled Code)
>         at
>
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java,

>
> Compiled Code)
>         at
>
org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java,

>
> Compiled Code)
>         at
>
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java,

>
> Compiled Code)
>         at
>
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java,

>
> Compiled Code)
>         at
>
org.apache.xerces.framework.XMLParser.parse(XMLParser.java:900)
>         at
> org.jdom.input.SAXBuilder.build(SAXBuilder.java,
> Compiled Code)
>         at
> org.jdom.input.SAXBuilder.build(SAXBuilder.java:464)
> .
> .
> .
>
> FYI, I have tried changing my uri to other values,
> but I have received the same
> error every time.
>
> What is this error and how can I fix it?
>
> Thanks.
>
>
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/





More information about the jdom-interest mailing list