public static GetInScopeNamespaces ( XPathNode pageElem, int idxElem, XPathNode &pageNmsp ) : int | ||
pageElem | XPathNode | |
idxElem | int | |
pageNmsp | XPathNode | |
return | int |
/// <summary> /// Position the navigator on the namespace within the specified scope. If no matching namespace /// can be found, return false. /// </summary> public override bool MoveToFirstNamespace(XPathNamespaceScope namespaceScope) { XPathNode[] page; int idx; if (namespaceScope == XPathNamespaceScope.Local) { // Get local namespaces only idx = XPathNodeHelper.GetLocalNamespaces(_pageCurrent, _idxCurrent, out page); } else { // Get all in-scope namespaces idx = XPathNodeHelper.GetInScopeNamespaces(_pageCurrent, _idxCurrent, out page); } while (idx != 0) { // Don't include the xmlns:xml namespace node if scope is ExcludeXml if (namespaceScope != XPathNamespaceScope.ExcludeXml || !page[idx].IsXmlNamespaceNode) { _pageParent = _pageCurrent; _idxParent = _idxCurrent; _pageCurrent = page; _idxCurrent = idx; return(true); } // Skip past xmlns:xml idx = page[idx].GetSibling(out page); } return(false); }
public override bool MoveToFirstNamespace(XPathNamespaceScope namespaceScope) { XPathNode[] nodeArray; int sibling; if (namespaceScope == XPathNamespaceScope.Local) { sibling = XPathNodeHelper.GetLocalNamespaces(this.pageCurrent, this.idxCurrent, out nodeArray); } else { sibling = XPathNodeHelper.GetInScopeNamespaces(this.pageCurrent, this.idxCurrent, out nodeArray); } while (sibling != 0) { if ((namespaceScope != XPathNamespaceScope.ExcludeXml) || !nodeArray[sibling].IsXmlNamespaceNode) { this.pageParent = this.pageCurrent; this.idxParent = this.idxCurrent; this.pageCurrent = nodeArray; this.idxCurrent = sibling; return(true); } sibling = nodeArray[sibling].GetSibling(out nodeArray); } return(false); }