From 94a3fc4985e50f82f83c550c9744cf5e461bc849 Mon Sep 17 00:00:00 2001 From: Philip Helger Date: Wed, 29 Dec 2021 19:51:31 +0100 Subject: [PATCH] Using attribute group for rich attrs --- .../src/main/resources/schemas/svrl.xsd | 29 ++++++++----------- .../xpath/PSXPathValidationHandlerSVRL.java | 10 +++++++ 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/ph-schematron-api/src/main/resources/schemas/svrl.xsd b/ph-schematron-api/src/main/resources/schemas/svrl.xsd index b6d82cb53..fe608064e 100644 --- a/ph-schematron-api/src/main/resources/schemas/svrl.xsd +++ b/ph-schematron-api/src/main/resources/schemas/svrl.xsd @@ -70,10 +70,7 @@ - - - - + @@ -83,12 +80,7 @@ - - - - - - + @@ -131,9 +123,7 @@ - - - + @@ -178,6 +168,14 @@ + + + + + + + + @@ -185,9 +183,6 @@ - - - - + diff --git a/ph-schematron-pure/src/main/java/com/helger/schematron/pure/validation/xpath/PSXPathValidationHandlerSVRL.java b/ph-schematron-pure/src/main/java/com/helger/schematron/pure/validation/xpath/PSXPathValidationHandlerSVRL.java index fa550e90b..d15b89d3b 100644 --- a/ph-schematron-pure/src/main/java/com/helger/schematron/pure/validation/xpath/PSXPathValidationHandlerSVRL.java +++ b/ph-schematron-pure/src/main/java/com/helger/schematron/pure/validation/xpath/PSXPathValidationHandlerSVRL.java @@ -187,6 +187,16 @@ public void onFiredRule (@Nonnull final PSRule aRule, aRetRule.setId (aRule.getID ()); if (aRule.hasLinkable ()) aRetRule.setRole (aRule.getLinkable ().getRole ()); + final PSRichGroup aRich = aRule.getRich (); + if (aRich != null) + { + aRetRule.setLang (aRich.getXmlLang ()); + if (aRich.hasXmlSpace ()) + aRetRule.setSpace (aRich.getXmlSpace ().getID ()); + aRetRule.setIcon (aRich.getIcon ()); + aRetRule.setSee (aRich.getSee ()); + aRetRule.setFpi (aRich.getFPI ()); + } m_aSchematronOutput.getActivePatternAndFiredRuleAndFailedAssert ().add (aRetRule); }