[jdom-interest] Schema validation using Beta 6

philip.nelson at omniresources.com philip.nelson at omniresources.com
Sat May 5 07:36:36 PDT 2001


looks like you have an older version of the org.w3c classes before xerces
somewhere in your classpath.  As always, check your classpath for other
parsers which unfortunately usually put the w3c classes in thier jar.  You
may have something in your jre/lib/ext directory that has the dom classes in
as well.

> -----Original Message-----
> From: Larry Davies [mailto:Larry_Davies at notes.compaid.com]
> Sent: Friday, May 04, 2001 2:55 PM
> To: jdom-interest at jdom.org
> Subject: Re: [jdom-interest] Schema validation using Beta 6
> 
> 
> 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.callStartElem
> ent(XMLValidator.java,
> 
> Compiled Code)
>         at
> org.apache.xerces.framework.XMLDocumentScanner.scanElement(XML
> DocumentScanner.java,
> 
> Compiled Code)
>         at
> org.apache.xerces.framework.XMLDocumentScanner$ContentDispatch
> er.dispatch(XMLDocumentScanner.java,
> 
> Compiled Code)
>         at
> org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDo
> cumentScanner.java,
> 
> Compiled Code)
>         at 
> org.apache.xerces.framework.XMLParser.parse(XMLParser.java:952)
>         at
> org.apache.xerces.validators.common.XMLValidator.resolveSchema
> Grammar(XMLValidator.java:2437)
> 
>         at
> org.apache.xerces.validators.common.XMLValidator.bindNamespace
> sToElementAndAttributes(XMLValidator.java,
> 
> Compiled Code)
>         at
> org.apache.xerces.validators.common.XMLValidator.callStartElem
> ent(XMLValidator.java,
> 
> Compiled Code)
>         at
> org.apache.xerces.framework.XMLDocumentScanner.scanElement(XML
> DocumentScanner.java,
> 
> Compiled Code)
>         at
> org.apache.xerces.framework.XMLDocumentScanner$ContentDispatch
> er.dispatch(XMLDocumentScanner.java,
> 
> Compiled Code)
>         at
> org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDo
> cumentScanner.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.validateEleme
> ntAndAttributes(XMLValidator.java,
> 
> >
> > Compiled Code)
> >         at
> >
> org.apache.xerces.validators.common.XMLValidator.callStartElem
> ent(XMLValidator.java,
> 
> >
> > Compiled Code)
> >         at
> >
> org.apache.xerces.framework.XMLDocumentScanner.scanElement(XML
> DocumentScanner.java,
> 
> >
> > Compiled Code)
> >         at
> >
> org.apache.xerces.framework.XMLDocumentScanner$ContentDispatch
> er.dispatch(XMLDocumentScanner.java,
> 
> >
> > Compiled Code)
> >         at
> >
> org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDo
> cumentScanner.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/yo
uraddr at yourhost.com



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


_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com



More information about the jdom-interest mailing list