- private static TypedDataSchemaNode getCorrespondingTypedSchemaNode(final SchemaContext schemaContext,
- final NormalizedNodeContext currentNodeContext) {
- Iterator<NormalizedNodeContext> ancestorOrSelfAxisIterator;
- try {
- ancestorOrSelfAxisIterator = currentNodeContext.getContextSupport().getNavigator()
- .getAncestorOrSelfAxisIterator(currentNodeContext);
- } catch (UnsupportedAxisException ex) {
- throw new JaxenRuntimeException(ex);
- }
-
- final Deque<QName> schemaPathToCurrentNode = new ArrayDeque<>();
- while (ancestorOrSelfAxisIterator.hasNext()) {
- final NormalizedNode<?, ?> nextNode = ancestorOrSelfAxisIterator.next().getNode();
- if (!(nextNode instanceof MapNode) && !(nextNode instanceof LeafSetNode)
- && !(nextNode instanceof AugmentationNode)) {
- schemaPathToCurrentNode.addFirst(nextNode.getNodeType());
- }
- }
-
- final SchemaNode schemaNode = SchemaContextUtil.findNodeInSchemaContext(schemaContext, schemaPathToCurrentNode);
-
- Preconditions.checkNotNull(schemaNode, "Node %s does not have a corresponding SchemaNode in the SchemaContext.",
- currentNodeContext.getNode());
+ private static TypedDataSchemaNode getCorrespondingTypedSchemaNode(final NormalizedNodeContext currentNodeContext) {
+ final DataSchemaNode schemaNode = currentNodeContext.getSchema().getDataSchemaNode();