Ecvc-elt.1:Cannot find the declaration of element 'database'

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Marc

Ecvc-elt.1:Cannot find the declaration of element 'database'

Post by Marc »

Hi,

I have just started learning XML and I don't know what this error message means. How can I solve this problem. I made a project containing a xml-doc and a xsd-doc. The xsd is valid but the xml not, why?

xml-doc:
<?xml version="1.0" encoding="ISO-8859-1">
<database xmlns="http://www.w3.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:SchemaLocation="database.xsd">
<department>...

xsd-doc:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace="http://www.w3.org">
<xs:element name="database">...

Please help me.
email: BlattM@web.de
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Mark,

First your document is not well formed the XML header should end with
?>. Then the schemaLocation attribute is specified as SchemaLocation. Third the schemaLocation attribute should contain pairs of the form namespace uri followed by schema location, see http://www.w3.org/TR/xmlschema-1/#schema-loc

Correcting these gets something like below:

Code: Select all


<?xml version="1.0" encoding="ISO-8859-1"?>
<database xmlns="http://www.w3.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org database.xsd">

</database>
which you should validate without further problems.

Best Regards,
George
Post Reply