// The following process collects the preprocessed events
// without permitting the events to be replayed to the rest
// of the pipeline. This allows the preprocessing to be
// performed before checking the complexity of the SAX
// events
XMLProcess process = processedEventRecorder.getRecordingProcess();
// Make sure that the pipeline will direct all preprocessed
// SAX events to the new event recorder
target.addHeadProcess(process);
// This will cause the original event recorder to send the
// original SAX events to the target pipeline which will
// then preprocess them (we assume) and send them to the
// event collection process
try {
PipelinePlayer player = recording.createPlayer();
player.play(target.getPipelineProcess());
recording = processedEventRecorder.stopRecording();
} finally {
// Must always remove the collection process so that the
// pipeline isn't messed up
target.removeHeadProcess();
}
evaluationMode = EvaluationMode.IMMEDIATE;
}
// Verify that the event recorder contains compatible markup
if (complexity != Complexity.COMPLEX) {
if (evaluationMode == EvaluationMode.REPEATED) {
// Add a process that will only allow characters and ignorable
// whitespace events through to perform the complexity testing
addComplexityChecker(target, parameter);
} else if (recording.isComplex()) {
throw new XMLPipelineException("The " + parameter +
" value's type is simple but complex markup " +
"has been found", null);
}
}
try {
// Add the dependency information for this value to the pipeline.
DependencyContext dependencyContext =
context.getDependencyContext();
dependencyContext.addDependency(dependency);
XMLProcess process;
// Select the process to which the content should be sent based
// on whether it needs to be processed through the dynamic pipeline
// or not.
if (evaluationMode == EvaluationMode.REPEATED) {