Search in sources :

Example 1 with PSActive

use of com.helger.schematron.pure.model.PSActive in project ph-schematron by phax.

the class PSPreprocessor method _getPreprocessedPhase.

@Nonnull
private static PSPhase _getPreprocessedPhase(@Nonnull final PSPhase aPhase, @Nonnull final PreprocessorIDPool aIDPool) throws SchematronPreprocessException {
    final PSPhase ret = new PSPhase();
    ret.setID(aIDPool.getUniqueID(aPhase.getID()));
    ret.setRich(aPhase.getRichClone());
    if (aPhase.hasAnyInclude())
        throw new SchematronPreprocessException("Cannot preprocess <phase> with an <include>");
    for (final IPSElement aElement : aPhase.getAllContentElements()) {
        if (aElement instanceof PSActive)
            ret.addActive(((PSActive) aElement).getClone());
        else if (aElement instanceof PSLet)
            ret.addLet(((PSLet) aElement).getClone());
    // ps are ignored
    }
    ret.addForeignElements(aPhase.getAllForeignElements());
    ret.addForeignAttributes(aPhase.getAllForeignAttributes());
    return ret;
}
Also used : IPSElement(com.helger.schematron.pure.model.IPSElement) PSPhase(com.helger.schematron.pure.model.PSPhase) PSLet(com.helger.schematron.pure.model.PSLet) PSActive(com.helger.schematron.pure.model.PSActive) Nonnull(javax.annotation.Nonnull)

Aggregations

IPSElement (com.helger.schematron.pure.model.IPSElement)1 PSActive (com.helger.schematron.pure.model.PSActive)1 PSLet (com.helger.schematron.pure.model.PSLet)1 PSPhase (com.helger.schematron.pure.model.PSPhase)1 Nonnull (javax.annotation.Nonnull)1