XPathNavigator.SelectDescendants 方法

定義

選取目前節點中,所有符合選取準則的子代節點。

多載

SelectDescendants(XPathNodeType, Boolean)

選取目前節點中,所有具有相符 XPathNodeType 的子代節點。

SelectDescendants(String, String, Boolean)

選取目前節點中,所有具有指定區域名稱和命名空間 URI 的子代節點。

SelectDescendants(XPathNodeType, Boolean)

Source:
XPathNavigator.cs
Source:
XPathNavigator.cs
Source:
XPathNavigator.cs

選取目前節點中,所有具有相符 XPathNodeType 的子代節點。

public:
 virtual System::Xml::XPath::XPathNodeIterator ^ SelectDescendants(System::Xml::XPath::XPathNodeType type, bool matchSelf);
public virtual System.Xml.XPath.XPathNodeIterator SelectDescendants (System.Xml.XPath.XPathNodeType type, bool matchSelf);
abstract member SelectDescendants : System.Xml.XPath.XPathNodeType * bool -> System.Xml.XPath.XPathNodeIterator
override this.SelectDescendants : System.Xml.XPath.XPathNodeType * bool -> System.Xml.XPath.XPathNodeIterator
Public Overridable Function SelectDescendants (type As XPathNodeType, matchSelf As Boolean) As XPathNodeIterator

參數

type
XPathNodeType

子代節點的 XPathNodeType

matchSelf
Boolean

若要將內容節點包含在選取項目中,則為 true,否則為 false

傳回

XPathNodeIterator,包含選取的節點。

範例

如需選取上階、子系和子系節點的範例,請參閱 SelectAncestors

備註

方法 SelectDescendants 不會影響 的狀態 XPathNavigator

另請參閱

適用於

SelectDescendants(String, String, Boolean)

Source:
XPathNavigator.cs
Source:
XPathNavigator.cs
Source:
XPathNavigator.cs

選取目前節點中,所有具有指定區域名稱和命名空間 URI 的子代節點。

public:
 virtual System::Xml::XPath::XPathNodeIterator ^ SelectDescendants(System::String ^ name, System::String ^ namespaceURI, bool matchSelf);
public virtual System.Xml.XPath.XPathNodeIterator SelectDescendants (string name, string namespaceURI, bool matchSelf);
abstract member SelectDescendants : string * string * bool -> System.Xml.XPath.XPathNodeIterator
override this.SelectDescendants : string * string * bool -> System.Xml.XPath.XPathNodeIterator
Public Overridable Function SelectDescendants (name As String, namespaceURI As String, matchSelf As Boolean) As XPathNodeIterator

參數

name
String

子代節點的區域名稱。

namespaceURI
String

子代節點的命名空間 URI。

matchSelf
Boolean

若要將內容節點包含在選取項目中,則為 true,否則為 false

傳回

XPathNodeIterator,包含選取的節點。

例外狀況

null 不能做為參數傳遞。

範例

如需選取上階、子系和子系節點的範例,請參閱 SelectAncestors

備註

如果 String.Empty 指定為 name 參數,則會選取屬於指定命名空間 URI 的所有子系節點。 如果 String.Empty 指定為 namespaceURI 參數,則會選取屬於任何命名空間之指定區功能變數名稱稱的所有子代節點。 如果本機名稱和命名空間 URI 參數都是 String.Empty ,則會選取屬於任何命名空間的所有子代節點。

子系是子系或子系的子系等等;因此,選取的節點永遠不會包含屬性或命名空間節點。

方法 SelectDescendants 不會影響 的狀態 XPathNavigator

另請參閱

適用於