switch (node.getNodeKind()) {
case Type.DOCUMENT: {
if (node instanceof TinyNodeImpl) {
return new TinyTreeEventIterator(((TinyNodeImpl)node), pipe);
} else {
SequenceIterator content = node.iterateAxis(Axis.CHILD);
EventIterator contentEvents = new EventIteratorOverSequence(content);
return new BracketedDocumentIterator(
new Decomposer(contentEvents, pipe));
}
}
case Type.ELEMENT: {
if (node instanceof TinyNodeImpl) {
return new TinyTreeEventIterator(((TinyNodeImpl)node), pipe);
} else {
SequenceIterator content = node.iterateAxis(Axis.CHILD);
EventIterator contentEvents = new EventIteratorOverSequence(content);
StartElementEvent see = new StartElementEvent(pipe);
see.setNameCode(node.getNameCode());
see.setTypeCode(node.getTypeAnnotation());
see.setLocalNamespaces(node.getDeclaredNamespaces(null));