ph-schematron/src/main/java/com/helger/schematron/pure/binding/xpath/PSXPathVariables.java
@Nonnull
  public EChange add (@Nonnull @Nonempty final String sName, @Nonnull @Nonempty final String sValue)
  {
    ValueEnforcer.notEmpty (sName, "Name");
    ValueEnforcer.notEmpty (sValue, "Value");

    // Prepend the "$" prefix to the variable name
    final String sRealName = PSXPathQueryBinding.PARAM_VARIABLE_PREFIX + sName;
    if (m_aMap.containsKey (sRealName))
      return EChange.UNCHANGED;

    // Apply all existing variables to this variable value!
    // This ensures that all variables used in variables are resolved correctly
    // as long as the order of declaration is correct.
    // Additionally this means that the order of the variables in this class is
    // irrelevant
    final String sRealValue = getAppliedReplacement (sValue);
    m_aMap.put (sRealName, sRealValue);
    return EChange.CHANGED;
  }
@Nonnull
  public EChange add (@Nonnull @Nonempty final String sName, @Nonnull @Nonempty final String sValue)
  {
    ValueEnforcer.notEmpty (sName, "Name");
    ValueEnforcer.notEmpty (sValue, "Value");

    // Prepend the "$" prefix to the variable name
    final String sRealName = PSXPathQueryBinding.PARAM_VARIABLE_PREFIX + sName;
    if (m_aMap.containsKey (sRealName))
      return EChange.UNCHANGED;

    // Apply all existing variables to this variable value!
    // This ensures that all variables used in variables are resolved correctly
    // as long as the order of declaration is correct.
    // Additionally this means that the order of the variables in this class is
    // irrelevant
    final String sRealValue = getAppliedReplacement (sValue);
    m_aMap.put (sRealName, sRealValue);
    return EChange.CHANGED;
  }
Add a new variable.

@param sName
The name of the variable. May neither be <code>null</code> nor
empty.
@param sValue
The value of the variable. May neither be <code>null</code> nor
empty.
@return {@link EChange#UNCHANGED} if a variable with the same name is
already present. Never <code>null</code>.