SPFieldLink.XPath property

Gets or sets an XML Path Language (XPath) expression that represents the location of a property within an XML document of this content type.

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

Syntax

'Declaration
Public Property XPath As String
    Get
    Set
'Usage
Dim instance As SPFieldLink
Dim value As String

value = instance.XPath

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

Property value

Type: System.String
A string that contains an XPath expression. The default value is a null reference (Nothing in Visual Basic).

Remarks

This property enables XML document property promotion and demotion. If you store the value of the field that is represented by this SPFieldLink object in XML documents of this content type, you can use the XPath property to specify an XPath expression that represents the location of the property within the document. When you save changes to the document, the XML parser stores the value of the content type field in the document itself, at the node that is specified by the XPath expression. This process is called property demotion. Property promotion occurs when the XML parser reads the value at the specified node in the XML document and writes it to the field that is represented by this SPFieldLink object.

Important

To ensure that property promotion and demotion succeed, you must set the ReadOnly property of the SPFieldLink object to false.

If the node that is specified by the XPath expression stores a collection of values, you can use the AggregationFunction property to specify the action (sum, average, min, max, and so on) to take on the value set that is returned.

As an alternative to using the AggregateFunction property, you can use the PITarget and PIAttribute properties.

See also

Reference

SPFieldLink class

SPFieldLink members

Microsoft.SharePoint namespace

PITarget

Other resources

Using Content Types to Specify XML Document Properties

XMl Parser Processing

FieldRef Element (ContentType)

Fields and Field References