共用方式為


SPFieldLink.XPath property

取得或設定 XML 路徑語言 (XPath) 運算式,代表此內容類型的 XML 文件屬性的位置。

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
Public Property XPath As String
    Get
    Set
'用途
Dim instance As SPFieldLink
Dim value As String

value = instance.XPath

instance.XPath = value
public string XPath { get; set; }

Property value

Type: System.String
含有 XPath 運算式字串。預設值為a null reference (Nothing in Visual Basic)。

備註

此屬性可讓 XML 文件屬性升級和降級。如果您將儲存在此種內容類型的 XML 文件中的此SPFieldLink物件所表示之欄位的值,您可以使用XPath屬性來指定 XPath 運算式,代表文件內之屬性的位置。如果將變更儲存至文件,則 XML 剖析器會儲存文件中本身,節點的 XPath 運算式所指定內容類型欄位的值。此程序會呼叫降級的屬性。屬性升級發生於 XML 剖析器可讀取的 XML 文件中指定的節點的值,並將它寫入此SPFieldLink物件所表示的欄位。

重要

若要確保屬性升級和降級成功,您必須設定為false的SPFieldLink物件的ReadOnly屬性。

如果指定的 XPath 運算式的節點儲存的值集合,您可以使用AggregationFunction屬性來指定要設定傳回的值上採取的動作 (sum、 平均、 最小、 最大,依此類推)。

若要使用AggregateFunction屬性或者,您可以使用PITargetPIAttribute屬性。

請參閱

參照

SPFieldLink class

SPFieldLink members

Microsoft.SharePoint namespace

PITarget

其他資源

Using Content Types to Specify XML Document Properties

XMl Parser Processing

FieldRef Element (ContentType)

Fields and Field References