0
votes

I have an XSD schema and the root document is:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:camt.054.001.02" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:camt.054.001.02">
</xs:schema>

I load the schema into as schemaset as follows:

var schemas = new XmlSchemaSet();
using (var reader = new XmlTextReader(new StringReader(content)))
{
    schemas.Add(null, reader);
}

However, I get the following exception:

The root element of a W3C XML Schema should be and its namespace should be 'http://www.w3.org/2001/XMLSchema'.

What am I missing?

1

1 Answers

1
votes

I don't know what you mean by "root document" but all that you have shown us is the XML declaration, which is nothing to do with the problem.

The error message is saying that the outermost element of the schema document (immediately following the XML declaration) should be <xs:schema xmlns="http://www.w3.org/2001/XMLSchema">, and that this is not the case.