} else {
XMLConsumer consumer;
if (contentHandler instanceof XMLConsumer) {
consumer = (XMLConsumer)contentHandler;
} else if (contentHandler instanceof LexicalHandler) {
consumer = new ContentHandlerWrapper(contentHandler, (LexicalHandler)contentHandler);
} else {
consumer = new ContentHandlerWrapper(contentHandler);
}
// We have to add an environment changer
// clean environment stack handling.
EnvironmentStack envStack = CocoonComponentManager.getCurrentEnvironmentStack();
int currentOffset = envStack.getOffset();