You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Ben Rogers <sv...@yahoo.com> on 2003/04/17 15:57:57 UTC

Document is invalid: no grammar found

Im having some trouble going from Xerces 1.4.4 to 2.4 
I think that the problem may be that the SAX parser is
trying to look for the schema at the url, rather than
in my local file system.  Both the .xml and .xsd files
live in the same dir.  Can anyone shed some light on
what may be happening here?


Here is the .xsd file
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.ibm.com/tool"
attributeFormDefault="qualified"
elementFormDefault="qualified"
xmlns:tool="http://www.ibm.com/tool">
	<simpleType name="dirType">
		<annotation>
			<documentation>This type may not be too usefull. 
It just checks to see if you have /'s
etc.</documentation>
		</annotation>
		<restriction base="string">
			<pattern
value="[A-Z]?(:)?(\.)?((\/)?(\w)+)*(/)?"></pattern>
		</restriction>
	</simpleType>

	<simpleType name="jarType">
		<annotation>
			<documentation>This type checks the data to be sure
that it has .jar in it, as well as checks for /'s
etc.</documentation>
		</annotation>
		<restriction base="string">
			<pattern
value="[A-Z]?(:)?(\.)?((\/)?(\w)+)*(\.jar)||[A-Z]?(:)?(\.)?((\/)?(\w)+)*(\.JAR)"></pattern>
			<minLength value="4"></minLength>
		</restriction>
	</simpleType>

	<simpleType name="zipType">
		<annotation>
			<documentation>See jarType for
explination</documentation>
		</annotation>
		<restriction base="string">
			<pattern
value="[A-Z]?(:)?(\.)?((\/)?(\w)+)*(\.zip)||[A-Z]?(:)?(\.)?((\/)?(\w)+)*(\.ZIP)"></pattern>
			<minLength value="4"></minLength>
		</restriction>
	</simpleType>

	<complexType name="archiveFilesType">
		<annotation>
			<documentation>This type allows for as many jar and
zip files as needed.</documentation>
		</annotation>
		<choice minOccurs="0" maxOccurs="unbounded">
			<element name="ZipFile" type="tool:zipType"
form="qualified"></element>
			<element name="JarFile" type="tool:jarType"
form="qualified"></element>
			<element name="ClassPath" type="tool:dirType"
form="qualified"></element>
		</choice>
	</complexType>

	<complexType name="configType">
		<annotation>
			<documentation>This type is for the general config
stuff.  The elements where something is required have
nillable=&quot;false&quot;</documentation>
		</annotation>
		<all>
			<element name="SuiteOutputDir" type="tool:dirType"
nillable="false" form="qualified"></element>
			<element name="SuiteTestFile"
type="tool:xmlFileType" nillable="false"
form="qualified"></element>
			<element name="SuiteClass" type="string"
form="qualified"></element>
		</all>
	</complexType>

	<complexType name="suiteConfigType">
		<all>
			<element name="ClassPathEntries"
type="tool:archiveFilesType"
form="qualified"></element>
			<element name="Configuration"
type="tool:configType" minOccurs="1" maxOccurs="1"
form="qualified"></element>
		</all>
		<attribute name="suiteName" type="tool:nameType"
use="required" form="qualified"></attribute>
	</complexType>

	

	<complexType name="suiteType">
		<choice minOccurs="1" maxOccurs="unbounded">
			<element name="Suite" type="tool:suiteConfigType"
form="qualified"></element>
		</choice>
	</complexType>

	<element name="TestRun"
type="tool:superType"></element>



	<simpleType name="xmlFileType">
		<restriction base="string">
			<pattern value=".+(\.)(xml|XML)"></pattern>
		</restriction>
	</simpleType>

	<complexType name="suiteGroup">
		<choice minOccurs="1" maxOccurs="unbounded">
			<element name="Group" type="tool:suiteType"
form="qualified"></element>
			
		</choice>
	</complexType>

	<simpleType name="nameType">
		<restriction base="string">
			<minLength value="1"></minLength>
		</restriction>
	</simpleType>

	<complexType name="superType">
		<all>
			<element name="GlobalOutputDir" type="tool:dirType"
form="qualified"></element>
			<element name="Test" type="tool:suiteGroup"
form="qualified"></element>
		</all>
	</complexType>

</schema>


and the .xml file
<?xml version="1.0" encoding="UTF-8"?>
<tool:TestRun xmlns:tool="http://www.ibm.com/tool" 
             
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
             
xsi:schemaLocation="http://www.ibm.com/tool Tool.xsd">
 
<tool:GlobalOutputDir>D:/test/</tool:GlobalOutputDir>
  <tool:Test>
    <tool:Group>
      <tool:Suite tool:suiteName="BensSuite1">
        <tool:ClassPathEntries/>
        <tool:Configuration>
         
<tool:SuiteOutputDir>D:/temp/test/</tool:SuiteOutputDir>
         
<tool:SuiteTestFile>D:/eclipse/workspace/Tool/src/Test.xml</tool:SuiteTestFile>
         
<tool:SuiteClass>com.ibm.tool.samples.SampleSuite</tool:SuiteClass>
        </tool:Configuration>
      </tool:Suite>
    </tool:Group>
  </tool:Test>
</tool:TestRun>


and the traceback
Problem parsing the input file.
org.jdom.input.JDOMParseException: Error on line 2 of
document file:/D:/eclipse/workspace/Tool/src/Tool.xml:
Document is invalid: no grammar found.
	at
org.jdom.input.SAXBuilder.build(SAXBuilder.java:377)
	at
org.jdom.input.SAXBuilder.build(SAXBuilder.java:724)
	at
org.jdom.input.SAXBuilder.build(SAXBuilder.java:703)
	at
com.ibm.tool.suite.SuiteControler.parseInputFile(SuiteControler.java:157)
	at
com.ibm.tool.suite.SuiteControler.<init>(SuiteControler.java:65)
	at com.ibm.tool.MainClass.runTool(MainClass.java:63)
	at com.ibm.tool.MainClass.main(MainClass.java:53)
Caused by: org.xml.sax.SAXParseException: Document is
invalid: no grammar found.
	at
org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
	at
org.jdom.input.SAXBuilder.build(SAXBuilder.java:370)
	... 6 more
Caused by: org.xml.sax.SAXParseException: Document is
invalid: no grammar found.
	at
org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
	at
org.jdom.input.SAXBuilder.build(SAXBuilder.java:370)
	at
org.jdom.input.SAXBuilder.build(SAXBuilder.java:724)
	at
org.jdom.input.SAXBuilder.build(SAXBuilder.java:703)
	at
com.ibm.tool.suite.SuiteControler.parseInputFile(SuiteControler.java:157)
	at
com.ibm.tool.suite.SuiteControler.<init>(SuiteControler.java:65)
	at com.ibm.tool.MainClass.runTool(MainClass.java:63)
	at com.ibm.tool.MainClass.main(MainClass.java:53)
Caused by: org.xml.sax.SAXParseException: Document is
invalid: no grammar found.
	at
org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
	at
org.jdom.input.SAXBuilder.build(SAXBuilder.java:370)
	at
org.jdom.input.SAXBuilder.build(SAXBuilder.java:724)
	at
org.jdom.input.SAXBuilder.build(SAXBuilder.java:703)
	at
com.ibm.tool.suite.SuiteControler.parseInputFile(SuiteControler.java:157)
	at
com.ibm.tool.suite.SuiteControler.<init>(SuiteControler.java:65)
	at com.ibm.tool.MainClass.runTool(MainClass.java:63)
	at com.ibm.tool.MainClass.main(MainClass.java:53)
Problem with the SuiteControler!



__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com

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