tree data BUGFIX skip schema-only nodes
diff --git a/src/tree_data.c b/src/tree_data.c
index 08b9d34..0be7463 100644
--- a/src/tree_data.c
+++ b/src/tree_data.c
@@ -1559,8 +1559,8 @@
     do {
         /* find the next parent */
         sp = schema;
-        while (sp->parent != src_parent) {
-            sp = sp->parent;
+        while (lysc_data_parent(sp) != src_parent) {
+            sp = lysc_data_parent(sp);
         }
         src_parent = sp;