I want to do schema validation using an XSD file. When I import the XSD file to Eclipse, without running the validation class, I have the following error:
src-resolve: Cannot resolve the name 'ds:Signature' to an 'element declaration' component
I am kinda new to XML vs XSD validation process. Although I have looked for similar questions on google, I couldn't figure out what's wrong here.
The XSD file is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xerces="http://xerces.apache.org"
xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:abc="http://abc.123.com" targetNamespace="http://abc.123.com"
xmlns:xades141="http://uri.etsi.org/01903/v1.4.1#" elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:import namespace="http://uri.etsi.org/01903/v1.3.2#" schemaLocation="XAdES.xsd"/>
<xs:import namespace="http://uri.etsi.org/01903/v1.4.1#" schemaLocation="XAdESv141.xsd"/>
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/>
<xs:complexType name="headerType">
<xs:sequence>
<xs:element name="doorNumber" type="xs:int"/>
<xs:element ref="ds:Signature"/>
</xs:sequence>
</xs:complexType>
How should I modify the XSD to fix this error?
ds:
out of theref
, or add a schema fords
as you havexs
. (You have to actually read both the error message and the XSD. Three lines up from the bottom.) – Consolidate