Binding.XPath Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets an XPath
query that returns the value on the XML binding source to use.
public:
property System::String ^ XPath { System::String ^ get(); void set(System::String ^ value); };
public string XPath { get; set; }
member this.XPath : string with get, set
Public Property XPath As String
Property Value
The XPath
query. The default is null
.
Remarks
When the binding source is XML data instead of a common language runtime (CLR) object, the XPath property is used instead of the Path property to indicate the path to the value on the binding source to use.
By setting the XPath property, you are creating an XPath
query to select a node or a collection of nodes (System.Xml.XmlElement and System.Xml.XmlAttribute both derive from System.Xml.XmlNode). System.Xml.XmlNode is a common language runtime (CLR) object, which means you can bind to its properties using the Path property.
The XmlNode.SelectNodes method handles the XPath
expressions from the XPath property. XPath
functions are not supported. For XPath
expression information, see the SelectNodes documentation and some examples provided in the Example section.
LINQ to XML objects XDocument and XElement do not use XPath
. For details, see How to: Bind to XDocument, XElement, or LINQ for XML Query Results.
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應