XmlProperties.XPath Property

XPath.Represents the attribte in schema: xpath

Namespace:  DocumentFormat.OpenXml.Spreadsheet
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)


<SchemaAttrAttribute(, "xpath")> _
Public Property XPath As StringValue
Dim instance As XmlProperties
Dim value As StringValue

value = instance.XPath

instance.XPath = value
[SchemaAttrAttribute(, "xpath")]
public StringValue XPath { get; set; }

Property Value

Type: DocumentFormat.OpenXml.StringValue
Returns StringValue.


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.

See Also


XmlProperties Class

XmlProperties Members

DocumentFormat.OpenXml.Spreadsheet Namespace