コード例 #1
0
        /// <summary>
        /// Return the result of FollowingSiblingAxis expression
        /// </summary>
        /// <param name="node">
        ///            is the type of node. </param>
        public override void iterate(NodeType node, ResultBuffer copyInto, Node limitNode)
        {
            // XXX check for attribute / namespace node... if so return
            // empty sequence

            Node iterNode = node.node_value();

            // get the children of the parent [siblings]
            do
            {
                iterNode = iterNode.NextSibling;
                if (iterNode != null)
                {
                    NodeType nodeType = NodeType.dom_to_xpath(iterNode, node.TypeModel);
                    if (nodeType != null)
                    {
                        copyInto.add(nodeType);
                    }
                }
            } while (iterNode != null);
        }
コード例 #2
0
        /// <summary>
        /// Get the ancestors of the context node.
        /// </summary>
        /// <param name="node">
        ///            is the type of node. </param>
        // XXX unify this with descendants axis ?
        public override void iterate(NodeType node, ResultBuffer copyInto, Node limitNode)
        {
            if (limitNode != null && limitNode.isSameNode(node.node_value()))
            {
                return;
            }

            int before = copyInto.size();

            // get the parent
            base.iterate(node, copyInto, limitNode);

            // no parent
            if (copyInto.size() == before)
            {
                return;
            }

            NodeType parent = (NodeType)copyInto.item(before);

            // get ancestors of parent
            iterate(parent, copyInto, limitNode);
        }