XSD: Element with namespace is not expected



I have a simple XSD Schema:



<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="urn:myNamespace" xmlns:xs="http://ift.tt/tphNwY" xmlns:ds="http://ift.tt/uq6naF" elementFormDefault="qualified" attributeFormDefault="unqualified" id="myList">
<xs:import namespace="http://ift.tt/uq6naF" schemaLocation="http://ift.tt/1pH7diL"/>
<xs:element name="abc">
<xs:complexType>
<xs:sequence>
<xs:element name="testElement" />
<xs:element name="Signature" type="ds:SignatureType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>


and XML file, which I want to validate:



<?xml version="1.0" encoding="UTF-8"?>
<abc>
<testElement>
</testElement>
<Signature xmlns="http://ift.tt/uq6naF">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://ift.tt/y9fQ1c"/>
<SignatureMethod Algorithm="http://ift.tt/zf1Wx4"/>
<Reference URI="">
<Transforms>
<Transform Algorithm="http://ift.tt/A1C4L2"/>
</Transforms>
<DigestMethod Algorithm="http://ift.tt/yuvO4a"/>
<DigestValue>value1</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>value2</SignatureValue>
<KeyInfo><KeyName/></KeyInfo>
</Signature>
</abc>


I use xmllint and I'm getting the following error:



file.xml:5: element Signature: Schemas validity error : Element '{http://ift.tt/KrD3Sf': This element is not expected. Expected is ( Signature ).
file.xml fails to validate


What am I doing wrong with XML namespaces? Is the problem in XSD or in XML?


No comments:

Post a Comment