This chapter serves as a quick reference to XQuery, XPath, and XML DML functionality as implemented in SQL Server 2008.
The FOR XML PATH provides support for naming result columns using a subset of XPath-style paths, including node tests. Path expressions in XPath consist of location steps separated by forward slash (/) characters. Each step of the path represents an element or attribute in a hierarchical XML structure. Listing D-1 shows sample FOR XML PATH XPath-style paths.
Example D-1. Sample Path Expressions in FOR XML PATH
@customer-number shipping-address/city address/billing-address/@postal-code
Path expressions used with
FOR XML PATH must follow certain rules, including the following: