closes #532
This commit is contained in:
@@ -419,11 +419,16 @@ public class XMLValidator extends Validator {
|
|||||||
* @param xml the xml to be checked
|
* @param xml the xml to be checked
|
||||||
* @param xsltFilename the filename of the intermediate XSLT file
|
* @param xsltFilename the filename of the intermediate XSLT file
|
||||||
* @param section the error type code, if one arises
|
* @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
|
* @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;
|
ISchematronResource aResSCH = null;
|
||||||
|
ESeverity severity=defaultSeverity;
|
||||||
|
if (defaultSeverity!=ESeverity.notice) {
|
||||||
|
severity=ESeverity.error;
|
||||||
|
}
|
||||||
|
|
||||||
aResSCH = SchematronResourceXSLT.fromClassPath(xsltFilename);
|
aResSCH = SchematronResourceXSLT.fromClassPath(xsltFilename);
|
||||||
|
|
||||||
if (aResSCH != null) {
|
if (aResSCH != null) {
|
||||||
@@ -465,6 +470,16 @@ public class XMLValidator extends Validator {
|
|||||||
thisFailLocation = currentFailNode.getAttributes().getNamedItem("location").getNodeValue();
|
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();
|
NodeList failChilds = currentFailNode.getChildNodes();
|
||||||
for (int failChildIndex = 0; failChildIndex < failChilds.getLength(); failChildIndex++) {
|
for (int failChildIndex = 0; failChildIndex < failChilds.getLength(); failChildIndex++) {
|
||||||
if (failChilds.item(failChildIndex).getLocalName() != null) {
|
if (failChilds.item(failChildIndex).getLocalName() != null) {
|
||||||
|
|||||||
@@ -115,9 +115,6 @@
|
|||||||
<ram:CityName>[Seller city]</ram:CityName>
|
<ram:CityName>[Seller city]</ram:CityName>
|
||||||
<ram:CountryID>DE</ram:CountryID>
|
<ram:CountryID>DE</ram:CountryID>
|
||||||
</ram:PostalTradeAddress>
|
</ram:PostalTradeAddress>
|
||||||
<ram:URIUniversalCommunication>
|
|
||||||
<ram:URIID schemeID="EM">seller@email.de</ram:URIID>
|
|
||||||
</ram:URIUniversalCommunication>
|
|
||||||
<ram:SpecifiedTaxRegistration>
|
<ram:SpecifiedTaxRegistration>
|
||||||
<ram:ID schemeID="VA">DE 123456789</ram:ID>
|
<ram:ID schemeID="VA">DE 123456789</ram:ID>
|
||||||
</ram:SpecifiedTaxRegistration>
|
</ram:SpecifiedTaxRegistration>
|
||||||
|
|||||||
Reference in New Issue
Block a user