4

I am validating an XML from an xsd but I have an error when I say that it has to validate a signature tag

this is the XML:

<?xml version="1.0" encoding="UTF-8"?>
<ValidaLinea>
    <cveBanco>40058</cveBanco>
    <importe>0</importe>
    <fechaHoraEnvio>2002-05-30T09:00:00</fechaHoraEnvio>
    <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">...
    </Signature>
</ValidaLinea>

and this is the 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#"
           >
<xs:complexType name="ValidaLinea">
    <xs:sequence>
        <xs:element name="cveBanco">
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:pattern value="[0-9]{5}" />
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="importe">
            <xs:simpleType>
                <xs:restriction base="xs:long">
                    <xs:totalDigits value="14" />
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="fechaHoraEnvio">
            <xs:simpleType>
                <xs:restriction base="xs:dateTime">
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="Signature" type="ds:Signature"/>
    </xs:sequence>
</xs:complexType> 
<xs:element name="ValidaLinea" type="ValidaLinea"/>
</xs:schema>

the error that shows me when I try to do the validation is the following:

Src-resolve.4.2: Error Resolving Component 'ds:Signature'.
It Was Detected That 'ds:Signature' Is In Namespace 'http://www.w3.org/2000/09/xmldsig#',
But Components From This Namespace Are Not Referenceable From Schema Document 'null'.

0

1 Answer 1

0

Probably it's too late but , you are missing the import into the XSD

<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"/>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.