[jdom-interest] Schema validation using Beta 6

Paul Jakubik pauljakubik at yahoo.com
Fri May 4 10:44:56 PDT 2001


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