+ return new Iterable<QName>() {
+ @Override
+ public Iterator<QName> iterator() {
+ return new Iterator<QName>() {
+ private SchemaPath current = SchemaPath.this;
+
+ @Override
+ public boolean hasNext() {
+ return current.parent != null;
+ }
+
+ @Override
+ public QName next() {
+ if (current.parent != null) {
+ final QName ret = current.qname;
+ current = current.parent;
+ return ret;
+ } else {
+ throw new NoSuchElementException("No more elements available");
+ }
+ }
+
+ @Override
+ public void remove() {
+ throw new UnsupportedOperationException("Component removal not supported");
+ }
+ };
+ }
+ };