closes #532
This commit is contained in:
@@ -419,11 +419,16 @@ public class XMLValidator extends Validator {
|
||||
* @param xml the xml to be checked
|
||||
* @param xsltFilename the filename of the intermediate XSLT file
|
||||
* @param section the error type code, if one arises
|
||||
* @param severity how serious a error should be treated - may only be notice
|
||||
* @param defaultSeverity how serious a error should be treated - may only be notice
|
||||
* @throws IrrecoverableValidationError if anything happened that prevents further checks
|
||||
*/
|
||||
public void validateSchematron(String xml, String xsltFilename, int section, ESeverity severity) throws IrrecoverableValidationError {
|
||||
public void validateSchematron(String xml, String xsltFilename, int section, ESeverity defaultSeverity) throws IrrecoverableValidationError {
|
||||
ISchematronResource aResSCH = null;
|
||||
ESeverity severity=defaultSeverity;
|
||||
if (defaultSeverity!=ESeverity.notice) {
|
||||
severity=ESeverity.error;
|
||||
}
|
||||
|
||||
aResSCH = SchematronResourceXSLT.fromClassPath(xsltFilename);
|
||||
|
||||
if (aResSCH != null) {
|
||||
@@ -465,6 +470,16 @@ public class XMLValidator extends Validator {
|
||||
thisFailLocation = currentFailNode.getAttributes().getNamedItem("location").getNodeValue();
|
||||
}
|
||||
|
||||
if (currentFailNode.getAttributes().getNamedItem("flag") != null) {
|
||||
// the XR issues warnings with flag=warning
|
||||
if (currentFailNode.getAttributes().getNamedItem("flag").getNodeValue().equals("warning")) {
|
||||
if (defaultSeverity!=ESeverity.notice) {
|
||||
severity=ESeverity.warning;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
NodeList failChilds = currentFailNode.getChildNodes();
|
||||
for (int failChildIndex = 0; failChildIndex < failChilds.getLength(); failChildIndex++) {
|
||||
if (failChilds.item(failChildIndex).getLocalName() != null) {
|
||||
|
||||
Reference in New Issue
Block a user