7.6. SQLXML Templates

Templates are XML documents that provide a parameterized query and update mechanism to the database. Templates can contain either T-SQL statements, Updategrams, XPath queries, or a combination thereof. Examples for Updategrams and XPath queries are given in section 7.7. Listing 7.8 shows the basic structure of a parameterized template that retrieves a Customer-Order hierarchy for a specific region and applies an XSLT post-processing step that transforms the template result into another XML document or some other format (such as HTML).

Listing 7.8. Example of a Parameterized Template
 <root xmlns:sql ="urn:schemas-microsoft-com:xml-sql" sql:xsl="CustOrd.xsl" > <sql:header nullvalue="NULL" > <sql:param name="City">%</sql:param> ...

Get XML Data Management: Native XML and XML-Enabled Database Systems 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.