xml - src-resolve: Cannot resolve the name 'ds:Signature' to an 'element declaration' component -
i want schema validation using xsd file. when import xsd file eclipse, without running validation class, have following error:
src-resolve: cannot resolve name 'ds:signature' 'element declaration' component
i kinda new xml vs xsd validation process. although have looked similar questions on google, couldn't figure out what's wrong here.
the xsd file 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 modify xsd fix error?
if have xmldsig-core-schema.xsd
in same directory xsd, and if same this xsd, should not getting error failure resolve ds:signature
.
therefore, suspect import failing, , you're missing or ignoring warning such following:
[warning] try.xsd:9:56: schema_reference.4: failed read schema document 'xmldsig-core-schema.xsd', because 1) not find document; 2) document not read; 3) root element of document not
<xsd:schema>
.
try xsd test; loads directly url xmldsig-core-schema.xsd
:
<?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:abc="http://abc.123.com" targetnamespace="http://abc.123.com" elementformdefault="qualified" attributeformdefault="unqualified"> <xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemalocation="http://www.w3.org/tr/2002/rec-xmldsig-core-20020212/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> </xs:schema>
i've tested above xsd , found eliminates resolution error seeing.
Comments
Post a Comment