Porteous96
Porteous96

Reputation: 97

Linking an XSD file to XML

I am new to XML and I am looking to link my schema to my xml file but I am receiving the following error using http://www.xpathtester.com/validate

ERROR - cvc-elt.1: Cannot find the declaration of element 'Courier'.

the .xml file:

<?xml version="1.0" encoding="UTF-8"?>
    <Courier xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="courier.xsd">
    //Omitted code
    </Courier>

The .xsd file:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
</xs:schema>

I've looked around at various answers related to this question but I don't understand what parts of their answers are required.

Any help is much appreciated.

Upvotes: 1

Views: 411

Answers (1)

Sebastiano franceschin
Sebastiano franceschin

Reputation: 161

In your xsd schema you don't have any "Courier" element. you need to add something like <xs:element name="Courier"> in your xsd file.

Upvotes: 2

Related Questions