if (_rootSchemaNode.label().equals(label)) {
if (_rootSchemaNode.isAttribute()) {
_root = new DocumentAttributeNode((AttributeSchemaNode)_rootSchemaNode);
_valueReader = new NodeValueReader();
} else {
_root = new DocumentGroupNode((GroupSchemaNode)_rootSchemaNode);
}
_elementStack.push(_root);
} else {
throw new WikiDataException(WikiDataException.InvaldInputData, "Expected root label " + _rootSchemaNode.label() + " instead of " + label);
}
} else if (!_elementStack.isEmpty()) {
DocumentNode element = _elementStack.peek();
if (element.isGroup()) {
DocumentGroupNode group = (DocumentGroupNode)element;
SchemaNode childSchemaNode = ((GroupSchemaNode)group.schema()).children().get(label);
if (childSchemaNode != null && childSchemaNode.getTimestamp().isCurrent()) {
DocumentNode child = null;
if (childSchemaNode.isAttribute()) {
child = new DocumentAttributeNode((AttributeSchemaNode)childSchemaNode);
_valueReader = new NodeValueReader();
} else {
child = new DocumentGroupNode((GroupSchemaNode)childSchemaNode);
}
group.children().add(child);
_elementStack.push(child);
} else {
_ignoreSubtreeDepth = 1;
}
} else {