public override XPathNodeIterator SelectDescendants( string localName, string namespaceURI, bool matchSelf ) {
string nsAtom = document.NameTable.Get( namespaceURI );
if ( nsAtom == null || this.source.NodeType == XmlNodeType.Attribute )
return new DocumentXPathNodeIterator_Empty( this );
Debug.Assert( this.NodeType != XPathNodeType.Attribute && this.NodeType != XPathNodeType.Namespace && this.NodeType != XPathNodeType.All );
string localNameAtom = document.NameTable.Get( localName );
if ( localNameAtom == null )
return new DocumentXPathNodeIterator_Empty( this );
if ( localNameAtom.Length == 0 ) {
if ( matchSelf )
return new DocumentXPathNodeIterator_ElemChildren_AndSelf_NoLocalName( this, nsAtom );
return new DocumentXPathNodeIterator_ElemChildren_NoLocalName( this, nsAtom );
}
if ( matchSelf )
return new DocumentXPathNodeIterator_ElemChildren_AndSelf( this, localNameAtom, nsAtom );
return new DocumentXPathNodeIterator_ElemChildren( this, localNameAtom, nsAtom );
}