My xml schema and my xml document are both valid and well-formed. But there is still a problem with the correct reference. I looked up a few similar questions but I can`t solve my problem.
Beginning of the xml schema:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.w3schools.com"
xmlns="http://www.w3schools.com">
<xs:element name="catalog"/>
xml schema example:
<xs:element name="Qstr">
<xs:complexType>
<xs:sequence>
<xs:element name="text" type="xs:string"/>
<xs:element name="a" type="xs:string"/>
<xs:element name="b" type="xs:string"/>
<xs:element name="c" type="xs:string"/>
<xs:element name="d" type="xs:string"/>
</xs:sequence>
</xs:complexType>
beginning of xml document:
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="http://www.w3schools.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3schools.com file:///home/n/workspace/webprog1/WebContent/schema.xml">
<Qstr>
<text>random question?</text>
<a>asdfasd</a>
<b>ertwetrewt</b>
<c>ghkghk</c>
<d>xcvbxcbbx</d>
</Qstr>
Error message:
Invalid content was found starting with element '{"http://www.w3schools.com":text}'. One of '{text}' is expected.