Class PSLet

java.lang.Object
com.helger.schematron.pure.model.PSLet
All Implemented Interfaces:
com.helger.commons.lang.ICloneable<PSLet>, IPSClonableElement<PSLet>, IPSElement

@NotThreadSafe public class PSLet extends Object implements IPSClonableElement<PSLet>
A single Schematron let-element.
If the let element is the child of a rule element, the variable is calculated and scoped to the current rule and context. Otherwise, the variable is calculated with the context of the instance document root.
The required name attribute is the name of the variable. The required value attribute is an expression evaluated in the current context.
It is an error to reference a variable that has not been defined in the current schema, phase, pattern, or rule, if the query language binding allows this to be determined reliably. It is an error for a variable to be multiply defined in the current schema, phase, pattern and rule.
The variable is substituted into assertion tests and other expressions in the same rule before the test or expression is evaluated. The query language binding specifies which lexical conventions are used to detect references to variables.
An implementation may provide a facility to override the values of top-level variables specified by let elements under the schema element. For example, an implementation may allow top-level variables to be supplied on the command line. The values provided are strings or data objects, not expressions.
Author:
Philip Helger
  • Constructor Details

    • PSLet

      public PSLet()
  • Method Details

    • isValid

      public boolean isValid(@Nonnull IPSErrorHandler aErrorHandler)
      Description copied from interface: IPSElement
      Check if this element is specified completely. This method stops at the first encountered error.
      Specified by:
      isValid in interface IPSElement
      Parameters:
      aErrorHandler - The error handler where the error details are stored. May not be null.
      Returns:
      true if all mandatory fields are set and the element is valid, false otherwise.
    • validateCompletely

      public void validateCompletely(@Nonnull IPSErrorHandler aErrorHandler)
      Description copied from interface: IPSElement
      Check if this element is specified completely. This method performs all validations independent of the number of encountered error.
      Specified by:
      validateCompletely in interface IPSElement
      Parameters:
      aErrorHandler - The error handler where the error details are stored. May not be null.
    • isMinimal

      public boolean isMinimal()
      Specified by:
      isMinimal in interface IPSElement
      Returns:
      true if this element conforms to the Schematron minimal syntax, false otherwise.
    • setName

      public void setName(@Nullable String sName)
      Parameters:
      sName - The name of the variable. May be null.
    • getName

      @Nullable public String getName()
      Returns:
      The name of the variable. May be null.
    • setValue

      public void setValue(@Nullable String sValue)
      Parameters:
      sValue - The value of the variable. May be null.
    • getValue

      @Nullable public String getValue()
      Returns:
      The value of the variable. May be null.
    • getAsMicroElement

      @Nonnull public com.helger.xml.microdom.IMicroElement getAsMicroElement()
      Specified by:
      getAsMicroElement in interface IPSElement
      Returns:
      The XML representation of this element. Never null.
    • getClone

      @Nonnull public PSLet getClone()
      Specified by:
      getClone in interface com.helger.commons.lang.ICloneable<PSLet>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • create

      @Nonnull @ReturnsMutableCopy public static PSLet create(@Nullable String sName, @Nullable String sValue)