Share via


XmlProperties.XPath Property

Definition

XPath

Represents the following attribute in the schema: xpath

[DocumentFormat.OpenXml.SchemaAttr(0, "xpath")]
public DocumentFormat.OpenXml.StringValue XPath { get; set; }
public DocumentFormat.OpenXml.StringValue XPath { get; set; }
[DocumentFormat.OpenXml.SchemaAttr(0, "xpath")]
public DocumentFormat.OpenXml.StringValue? XPath { get; set; }
[DocumentFormat.OpenXml.SchemaAttr("xpath")]
public DocumentFormat.OpenXml.StringValue? XPath { get; set; }
public DocumentFormat.OpenXml.StringValue? XPath { get; set; }
member this.XPath : DocumentFormat.OpenXml.StringValue with get, set
[<DocumentFormat.OpenXml.SchemaAttr(0, "xpath")>]
member this.XPath : DocumentFormat.OpenXml.StringValue with get, set
[<DocumentFormat.OpenXml.SchemaAttr("xpath")>]
member this.XPath : DocumentFormat.OpenXml.StringValue with get, set
Public Property XPath As StringValue

Property Value

Returns StringValue.

Attributes

Remarks

The following information from the ECMA International Standard ECMA-376 can be useful when working with this class.

A string representing the XML path to the element this column is associated with.

The spreadsheet application should support XPath limited to the following:

  • The XPath is an absolute path to a simple-content element or attribute.

    For example, /ns1:root/ns1:row/ns1:column1 is supported if column1 is a child-most node, but not /ns1:root/ns1:row for the same document since row is not a child.

  • The XPath does not express axes, but uses the default child axes.

    For example, /ns1:root/ns1:row is supported but not /ns1:root/child::ns1:row.

  • An optional filter can be expressed at the end of the xpath.

    For example, /ns1:root/ns1:row/ns1:column1[@foo='abc'] is supported but not /ns1:root/ns1:row[@foo='abc']/ns1:column1.

  • The filter can only contain a single expression comparing a named attribute to a specific value.

  • Filters are only supported on XPaths that resolve to a simple-content element (not attributes).

  • The named attribute must be defined as an attribute of the simple-content element.

  • The attribute name must be preceded by the shorthand (@) symbol representing the axes attribute.

    For example, /ns1:root/ns1:row/ns1:column1[@foo='abc'] is supported not /ns1:root/ns1:row/ns1:column1[attribute::foo='abc'].

  • An arbitrary amount of white space can be embedded between filter tokens.

    For example, /ns1:root/ns1:row/ns1:column1[ @ foo='abc'] is valid.

The possible values for this attribute are defined by the ST_Xstring simple type.

Applies to