Пример #1
0
        /// <summary>
        /// Signals the end of tree construction.
        /// </summary>
        public override void Close()
        {
            XPathNode[]? page;
            int idx;

            // If cached text exists, then create a text node at the top-level
            if (_textBldr.HasText)
            {
                CachedTextNode();
            }

            // If document does not yet contain nodes, then an empty text node must have been created
            idx = _doc.GetRootNode(out page);
            if (idx == _nodePageFact.NextNodeIndex && page == _nodePageFact.NextNodePage)
            {
                AddSibling(XPathNodeType.Text, string.Empty, string.Empty, string.Empty, string.Empty);
                _pageSibling[_idxSibling].SetValue(string.Empty);
            }
        }