You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-user@xml.apache.org by Radhakrishnan J <ra...@tavant.com> on 2004/05/24 22:00:28 UTC

FileNotFoundException while parsing an XML document !

Hi,

I get the following exception while trying to parse an XML document -

java.io.FileNotFoundException:  (No such file or directory)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:106)
	at java.io.FileInputStream.<init>(FileInputStream.java:66)
	at
sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:6
9)
	at
sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection
.java:156)
	at java.net.URL.openStream(URL.java:913)
	at
org.apache.xerces.impl.XMLEntityManager.startEntity(XMLEntityManager.java:74
0)
	at
org.apache.xerces.impl.XMLEntityManager.startDocumentEntity(XMLEntityManager
.java:685)
	at
org.apache.xerces.impl.XMLDocumentScannerImpl.setInputSource(XMLDocumentScan
nerImpl.java:252)
	at
org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserCo
nfiguration.java:503)
	at
org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserCo
nfiguration.java:585)
	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
	at
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:114
8)
	at org.apache.xmlbeans.impl.store.Root$SaxLoader.load(Root.java:735)
	at org.apache.xmlbeans.impl.store.Root.loadXml(Root.java:1036)
	at org.apache.xmlbeans.impl.store.Root.loadXml(Root.java:1022)
	at
org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderB
ase.java:319)
	at noNamespace.AuthorDocument$Factory.parse(Unknown Source)
	at
tavant.xml.transform.TestSubstitutionGroup.main(TestSubstitutionGroup.java:4
5)


Here is the XML document -
<?xml version="1.0" encoding="UTF-8"?>
<author xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="D:\ASAP\build\classes\checkSubstitution.xsd">
	<full-name>
		<first>Radhakrishnan</first>
		<middle>Jankiraman</middle>
		<last>Iyer</last>
	</full-name>
	<qualification>B. Tech(Honors) in Aerospace
Engineering</qualification>
</author>


And here is the Schema -
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="name"/>
<xs:element name="first-name" type="xs:string" substitutionGroup="name"/>
<xs:element name="full-name" substitutionGroup="name">
	<xs:complexType>
		<xs:all>
			<xs:element name="first" type="xs:string"
minOccurs="0"/>
			<xs:element name="middle" type="xs:string"
minOccurs="0"/>
			<xs:element name="last" type="xs:string"/>
		</xs:all>
	</xs:complexType>
</xs:element>
<xs:element name="author">
	<xs:complexType>
		<xs:sequence>
			<xs:element ref="name"/>
			<xs:element name="qualification" type="xs:string"/>
		</xs:sequence>
	</xs:complexType>
</xs:element>
</xs:schema>

Any idea whats going wrong here ? My OS is Windows and the file
D:\ASAP\build\classes\checkSubstitution.xsd does exists.

Thanks,
Radhakrishnan

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/