From 1fa74c7f87be7983ce001ed6bac745f9a42040e2 Mon Sep 17 00:00:00 2001 From: Philip Helger Date: Mon, 16 Sep 2024 09:57:40 +0200 Subject: [PATCH] Ctd --- .../schematron/ValidationExecutorSchematron.java | 2 +- .../helger/phive/xml/xsd/XSDPartialContext.java | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/phive-xml/src/main/java/com/helger/phive/xml/schematron/ValidationExecutorSchematron.java b/phive-xml/src/main/java/com/helger/phive/xml/schematron/ValidationExecutorSchematron.java index 9cfeaa8f..3791b5f0 100644 --- a/phive-xml/src/main/java/com/helger/phive/xml/schematron/ValidationExecutorSchematron.java +++ b/phive-xml/src/main/java/com/helger/phive/xml/schematron/ValidationExecutorSchematron.java @@ -578,7 +578,7 @@ public static ValidationExecutorSchematron createXSLT (@Nonnull final IReadableR /** * Create a new instance for a single resource that uses the precompiled XSLT - * Schematron validation. + * ISO Schematron validation. * * @param aRes * The resource pointing to the XSLT rules. May not be diff --git a/phive-xml/src/main/java/com/helger/phive/xml/xsd/XSDPartialContext.java b/phive-xml/src/main/java/com/helger/phive/xml/xsd/XSDPartialContext.java index 8196b371..3e9d684e 100644 --- a/phive-xml/src/main/java/com/helger/phive/xml/xsd/XSDPartialContext.java +++ b/phive-xml/src/main/java/com/helger/phive/xml/xsd/XSDPartialContext.java @@ -111,6 +111,21 @@ public static XSDPartialContext create (@Nonnull final XPathExpression aXE) return new XSDPartialContext (aXE, null, null); } + /** + * Create a new XSD partial context with a min and max node constraint of 1. + * + * @param aXE + * {@link XPathExpression} that must be satisfied. May not be + * null. + * @return The new XSDPartialContext and never null. + * @since 10.0.0 + */ + @Nonnull + public static XSDPartialContext createMandatory (@Nonnull final XPathExpression aXE) + { + return new XSDPartialContext (aXE, 1, 1); + } + /** * Create a new XSD partial context with a min and max node constraint. *