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);
}