GetAttribute() public static method

Return the attribute of the specified node that has the specified name. If no such attribute exists, then do not set pageNode or idxNode and return false. Assume that the localName has been atomized with respect to this document's name table, but not the namespaceName.
public static GetAttribute ( XPathNode &pageNode, int &idxNode, string localName, string namespaceName ) : bool
pageNode XPathNode
idxNode int
localName string
namespaceName string
return bool
Example #1
0
        public override bool MoveToAttribute(string localName, string namespaceURI)
        {
            XPathNode[] pageCurrent = this.pageCurrent;
            int         idxCurrent  = this.idxCurrent;

            if (localName != this.atomizedLocalName)
            {
                this.atomizedLocalName = (localName != null) ? this.NameTable.Get(localName) : null;
            }
            if (XPathNodeHelper.GetAttribute(ref this.pageCurrent, ref this.idxCurrent, this.atomizedLocalName, namespaceURI))
            {
                this.pageParent = pageCurrent;
                this.idxParent  = idxCurrent;
                return(true);
            }
            return(false);
        }
Example #2
0
        /// <summary>
        /// Position the navigator on the attribute with the specified name and return true.  If no matching
        /// attribute can be found, return false.  Don't assume the name parts are atomized with respect
        /// to this document.
        /// </summary>
        public override bool MoveToAttribute(string localName, string namespaceURI)
        {
            XPathNode[] page = _pageCurrent;
            int idx = _idxCurrent;

            if ((object)localName != (object)_atomizedLocalName)
                _atomizedLocalName = (localName != null) ? NameTable.Get(localName) : null;

            if (XPathNodeHelper.GetAttribute(ref _pageCurrent, ref _idxCurrent, _atomizedLocalName, namespaceURI))
            {
                // Save element parent in order to make node-order comparison simpler
                _pageParent = page;
                _idxParent = idx;
                return true;
            }

            return false;
        }
Example #3
0
        /// <summary>
        /// Position the navigator on the attribute with the specified name and return true.  If no matching
        /// attribute can be found, return false.  Don't assume the name parts are atomized with respect
        /// to this document.
        /// </summary>
        public override bool MoveToAttribute(string localName, string namespaceURI)
        {
            XPathNode[] page = this.pageCurrent;
            int         idx  = this.idxCurrent;

            if ((object)localName != (object)this.atomizedLocalName)
            {
                this.atomizedLocalName = (localName != null) ? NameTable.Get(localName) : null;
            }

            if (XPathNodeHelper.GetAttribute(ref this.pageCurrent, ref this.idxCurrent, this.atomizedLocalName, namespaceURI))
            {
                // Save element parent in order to make node-order comparison simpler
                this.pageParent = page;
                this.idxParent  = idx;
                return(true);
            }

            return(false);
        }