O'Reilly logo

Pro SQL Server 2008 XML by Michael Coles

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix D. XQuery/XPath/XML DML Quick Reference

This chapter serves as a quick reference to XQuery, XPath, and XML DML functionality as implemented in SQL Server 2008.

XPath

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:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required