- if (!schemaNodeName.equalsIgnoreCase(docRootElm)) {
- final DataSchemaNode foundSchemaNode = findSchemaNodeOrParentChoiceByName(schemaNode, docRootElm);
- if (foundSchemaNode != null) {
- if (schemaNode instanceof AugmentationTarget) {
- final AugmentationSchema augmentSchemaNode = findCorrespondingAugment(schemaNode, foundSchemaNode);
- if (augmentSchemaNode != null) {
- return parserFactory.getAugmentationNodeParser().parse(elements, augmentSchemaNode);
- }
+ if (isPost() && !isRpc) {
+ final Deque<Object> foundSchemaNodes = findPathToSchemaNodeByName(schemaNode, docRootElm);
+ if (foundSchemaNodes.isEmpty()) {
+ throw new IllegalStateException(String.format("Child \"%s\" was not found in parent schema node \"%s\"",
+ docRootElm, schemaNode.getQName()));
+ }
+ while (!foundSchemaNodes.isEmpty()) {
+ final Object child = foundSchemaNodes.pop();
+ if (child instanceof AugmentationSchema) {
+ final AugmentationSchema augmentSchemaNode = (AugmentationSchema) child;
+ iiToDataList.add(SchemaUtils.getNodeIdentifierForAugmentation(augmentSchemaNode));
+ } else if (child instanceof DataSchemaNode) {
+ schemaNode = (DataSchemaNode) child;
+ iiToDataList.add(new YangInstanceIdentifier.NodeIdentifier(schemaNode.getQName()));