Extensions 類別

定義

這門課包含 LINQ 轉 XML 的擴充方法,讓你能評估 XPath 表達式。

public ref class Extensions abstract sealed
public static class Extensions
type Extensions = class
Public Module Extensions
繼承
Extensions

備註

使用這些方法會帶來一些效能損失。 使用 LINQ 轉 XML 查詢能帶來更好的效能。

雖然 XML XPath 語言 1.0 建議中未規定回傳集合的順序,但此擴充方法會依文件順序回傳節點。

請注意,即使使用反向軸(如 preceding-siblingancestor-or-self),節點也會依文件順序回傳。

方法

名稱 Description
CreateNavigator(XNode, XmlNameTable)

會產生一個 XPathNavigator ,為 XNode。 這使得 XmlNameTable XPath 表達式處理更有效率。

CreateNavigator(XNode)

會產生一個 XPathNavigator ,為 XNode

XPathEvaluate(XNode, String, IXmlNamespaceResolver)

評估 XPath 表達式,並利用指定的 IXmlNamespaceResolver

XPathEvaluate(XNode, String)

評估一個 XPath 表達式。

XPathSelectElement(XNode, String, IXmlNamespaceResolver)

使用 XPath 表達式選取 , XElement 並用指定的 IXmlNamespaceResolver命名空間前綴解析。

XPathSelectElement(XNode, String)

使用 XPath 表達式選擇 。XElement

XPathSelectElements(XNode, String, IXmlNamespaceResolver)

使用 XPath 表達式選取一組元素,並用指定的 IXmlNamespaceResolver命名空間前綴解析。

XPathSelectElements(XNode, String)

使用 XPath 表達式選擇一組元素。

適用於