Пример #1
0
 /// <summary>
 /// Constructor </summary>
 /// <param name="parentNode"> the node which children shall be iterated. </param>
 /// <param name="parentPath"> the full path of the former node without the leaf node. </param>
 public NodeIteratorChildren(XMPIteratorImpl outerInstance, XMPNode parentNode, string parentPath)
     : base(outerInstance, parentNode, parentPath, 0)
 {
     this.outerInstance = outerInstance;
     if (parentNode.GetOptions().IsSchemaNode())
     {
         outerInstance.SetBaseNS(parentNode.GetName());
     }
     this.parentPath       = AccumulatePath(parentNode, parentPath, 1);
     this.childrenIterator = parentNode.IterateChildren();
 }
Пример #2
0
            /// <summary>
            /// Constructor for the node iterator. </summary>
            /// <param name="visitedNode"> the currently visited node </param>
            /// <param name="parentPath"> the accumulated path of the node </param>
            /// <param name="index"> the index within the parent node (only for arrays) </param>
            public NodeIterator(XMPIteratorImpl outerInstance, XMPNode visitedNode, string parentPath, int index)
            {
                this.outerInstance = outerInstance;
                this.visitedNode   = visitedNode;
                this.state         = ITERATE_NODE;
                if (visitedNode.GetOptions().IsSchemaNode())
                {
                    outerInstance.SetBaseNS(visitedNode.GetName());
                }

                // for all but the root node and schema nodes
                this.path = AccumulatePath(visitedNode, parentPath, index);
            }