// 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) {
// The evaluation mode is repeated so each time the content
// is played back it needs to be processed through the dynamic
// process which is accessed through the pipeline process.
process = target.getPipelineProcess();
} else {
// The content has already been processed so send it to the
// process after the dynamic process. That is either the
// head process, or if that is null the next process.
process = target.getHeadProcess();
if (process == null) {
process = target.getPipelineProcess().getNextProcess();
}
}
PipelinePlayer player = recording.createPlayer();
player.play(process);
} finally {
if (complexity != Complexity.COMPLEX &&
evaluationMode == EvaluationMode.REPEATED) {
// Remove the temporary process added above (this was added for
// complexity testing purposes)