Can not resolve the name 'ds: SignatureType' to a 'type definition' component

0

In Java, when having validate an XML by XSD I'm getting the message:

  

Can not resolve the name 'ds: SignatureType' to a 'type definition' component.

I have a REST service that receives an input XML, then validates the same with XSD and returns whether it is ok or not, but is giving this message at the time of validation.

My validation method is this:

public void valida(File xml, File xsd) throws Exception{
    Source schemaFile = new StreamSource(xsd);
    Source xmlFile = new StreamSource(xml);
    SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Schema schema = schemaFactory.newSchema(schemaFile); // Erro ocorre aqui
    Validator validator = schema.newValidator();
    validator.validate(xmlFile);
}
    
asked by anonymous 04.12.2018 / 11:56

0 answers