@Immutable public final class SchematronHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static SchematronOutputType |
applySchematron(ISchematronResource aSchematron,
com.helger.commons.io.resource.IReadableResource aXML)
Apply the passed schematron on the passed XML resource using a custom error
handler.
|
static SchematronOutputType |
applySchematron(ISchematronResource aSchematron,
Node aNode)
Apply the passed schematron on the passed XML node.
|
static SchematronOutputType |
applySchematron(ISchematronResource aSchematron,
Source aXML)
Apply the passed schematron on the passed XML resource.
|
static com.helger.commons.error.list.IErrorList |
convertToErrorList(SchematronOutputType aSchematronOutput,
String sResourceName)
Convert a
SchematronOutputType to an IErrorList. |
static com.helger.commons.collection.impl.ICommonsList<String> |
getAllValidSchematronNS(boolean bLenient)
Get a list of all supported namespaces.
|
static com.helger.xml.microdom.IMicroDocument |
getWithResolvedSchematronIncludes(com.helger.commons.io.resource.IReadableResource aResource)
Resolve all Schematron includes of the passed resource.
|
static com.helger.xml.microdom.IMicroDocument |
getWithResolvedSchematronIncludes(com.helger.commons.io.resource.IReadableResource aResource,
boolean bLenient)
Resolve all Schematron includes of the passed resource.
|
static com.helger.xml.microdom.IMicroDocument |
getWithResolvedSchematronIncludes(com.helger.commons.io.resource.IReadableResource aResource,
com.helger.xml.serialize.read.ISAXReaderSettings aSettings,
IPSErrorHandler aErrorHandler)
Resolve all Schematron includes of the passed resource.
|
static com.helger.xml.microdom.IMicroDocument |
getWithResolvedSchematronIncludes(com.helger.commons.io.resource.IReadableResource aResource,
com.helger.xml.serialize.read.ISAXReaderSettings aSettings,
IPSErrorHandler aErrorHandler,
boolean bLenient)
Resolve all Schematron includes of the passed resource.
|
static boolean |
isDeprecatedSchematronNS(String sNamespaceURI)
Check if the passed namespace URI is deprecated.
|
static boolean |
isValidSchematronNS(String sNamespaceURI,
boolean bLenient)
Check if the passed namespace URI is supported.
|
public static boolean isDeprecatedSchematronNS(@Nullable String sNamespaceURI)
sNamespaceURI - The namespace URI to check. May be null.true if the passed namespace URI is a deprecated
Schematron namespace URI, false if not.public static boolean isValidSchematronNS(@Nullable String sNamespaceURI, boolean bLenient)
sNamespaceURI - The namespace URI to check. May be null.bLenient - true to support old namespace URIs, false
if not.true if the passed namespace URI is a valid Schematron
namespace URI, false if not.@Nonnull @Nonempty @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsList<String> getAllValidSchematronNS(boolean bLenient)
bLenient - true to support old namespace URIs, false
if not.null and non-empty list of all supported
schematron namespace URIs.@Nullable public static SchematronOutputType applySchematron(@Nonnull ISchematronResource aSchematron, @Nonnull com.helger.commons.io.resource.IReadableResource aXML)
aSchematron - The Schematron resource. May not be null.aXML - The XML resource. May not be null.null if either the Schematron or the XML could not be
read.IllegalStateException - if the processing throws an unexpected exception.@Nullable public static SchematronOutputType applySchematron(@Nonnull ISchematronResource aSchematron, @Nonnull Source aXML)
aSchematron - The Schematron resource. May not be null.aXML - The XML resource. May not be null.null if either the Schematron or the XML could not be
read.IllegalStateException - if the processing throws an unexpected exception.@Nullable public static SchematronOutputType applySchematron(@Nonnull ISchematronResource aSchematron, @Nonnull Node aNode)
aSchematron - The Schematron resource. May not be null.aNode - The XML node. May not be null.null if either the Schematron or the XML could not be
read.IllegalStateException - if the processing throws an unexpected exception.@Nonnull public static com.helger.commons.error.list.IErrorList convertToErrorList(@Nonnull SchematronOutputType aSchematronOutput, @Nullable String sResourceName)
SchematronOutputType to an IErrorList.aSchematronOutput - The result of Schematron validationsResourceName - The name of the resource that was validated (may be a file path
etc.)null error list of SVRLResourceError
objects.@Nullable public static com.helger.xml.microdom.IMicroDocument getWithResolvedSchematronIncludes(@Nonnull com.helger.commons.io.resource.IReadableResource aResource)
aResource - The Schematron resource to read. May not be null.null if the passed resource could not be read as XML
document@Nullable public static com.helger.xml.microdom.IMicroDocument getWithResolvedSchematronIncludes(@Nonnull com.helger.commons.io.resource.IReadableResource aResource, boolean bLenient)
aResource - The Schematron resource to read. May not be null.bLenient - true if 'old' schematron NS is tolerated.null if the passed resource could not be read as XML
document@Nullable public static com.helger.xml.microdom.IMicroDocument getWithResolvedSchematronIncludes(@Nonnull com.helger.commons.io.resource.IReadableResource aResource, @Nullable com.helger.xml.serialize.read.ISAXReaderSettings aSettings, @Nonnull IPSErrorHandler aErrorHandler)
aResource - The Schematron resource to read. May not be null.aSettings - The SAX reader settings to be used. May be null to use
the default settings.aErrorHandler - The error handler to be used. May not be null.null if the passed resource could not be read as XML
document@Nullable public static com.helger.xml.microdom.IMicroDocument getWithResolvedSchematronIncludes(@Nonnull com.helger.commons.io.resource.IReadableResource aResource, @Nullable com.helger.xml.serialize.read.ISAXReaderSettings aSettings, @Nonnull IPSErrorHandler aErrorHandler, boolean bLenient)
aResource - The Schematron resource to read. May not be null.aSettings - The SAX reader settings to be used. May be null to use
the default settings.aErrorHandler - The error handler to be used. May not be null.bLenient - true if 'old' Schematron NS is tolerated.null if the passed resource could not be read as XML
documentCopyright © 2014–2020 Philip Helger. All rights reserved.