Using XPath Expressions

SharePoint Designer provides an XPath Express Builder for creating XPath expression. XPath is a language that can locate and process XML information. It can be used in the data view to create expressions to provide advanced sorts and calculated fields for data sources, whether they are XML sources or other sources like SQL databases or SharePoint lists. If you use XPath expressions on non-XML sources, the data is rendered first as XML and then the XPath expression is applied, so you may see a performance impact.

Working with the XPath Expression Builder is similar to working with functions in Excel. You can create formulas of the following types:

  • Math/Number: These functions perform mathematical operations such as returning the average, finding the minimum or maximum value, rounding a value up or down to the next integer, or formatting the number.

  • Text/String: These functions perform operations such as concatenating two values, calculating the length of a string, normalizing the spaces in a string of text, evaluating whether a string starts with or contains the value provided, or translating characters if present in a string with a new character.

  • Field/Node: These functions return values particular to the structure of the XML such as the namespace URI or all the comments or processing instructions present in the document.

  • Date/Time: These functions allow you to format the date or the date and time, return today’s date, and evaluate whether items have been created ...

Get Microsoft® SharePoint® Server 2007 Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.