OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Document is invalid: no grammar found

[ Lists Home | Date Index | Thread Index ]

Jose Airton wrote:

> 
> I created a XML instance : cd.xml and a schema cd.xsd.
> 
> In the begining of cd.xml, it is like the following:
> 
> <cd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:noNamespaceSchemaLocation="file:///c:/cd.xsd">
> 
> when I run parser, it always gives error message:
> 
> "Document is invalid: no grammar found.

The problem is in the specification of the schema location, but there 
are several possiblities.

1) Is the schema really at c:\cd.xsd?  That would be really unlikely. 
If you meant to use a relative path, you should say just "cd.xsd", if 
the schema is in the same directory as the source file, otherwise use a 
relative path starting from the document location without any "file:///" 
or "c:/".  Remember that the processor already knows the base of the 
document's path, and so does not need to be told "file:///" or whatever.

This is the most likely problem.  If the path you gave is truly the 
correct absolute path, then you may be getting bit by the fact that 
file: URIs are not adequately  specified by the rfc - and some 
processors think they should be receiving different formats for a file: 
URI, especially with a Windows path.

2) Try changing the slashes after "c:" to backslashes
3) Try changing from "file"///" to "file://" or "file:/" or "file:". 
Various processors in the past have wanted to have these (incorrect) 
variations.

Cheers,

Tom P




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS