Using XML Templates (MSSQL Manual)
The following is the general form of the template, showing how to specify SQL queries and XPath queries:
<ROOT xmlns:sql="urn:schemas-microsoft-com:xml-sql" sql:xsl='XSL FileName' > <sql:header> <sql:param>..</sql:param> <sql:param>..</sql:param>...n </sql:header> <sql:query> sql statement(s) </sql:query> <sql:xpath-query mapping-schema="SchemaFileName.xml"> XPath query </sql:xpath-query> </ROOT>
Any element in the template is optional. The elements
Specify this tag to provide a single top-level element (also called the root tag) of the resulting XML document. The
This tag is used to save all header values. In the current implementation, only the
This element is used to define the parameters passed to the query within the template. Each element defines a parameter. Multiple elements can be defined within the
This element is used to specify a SQL query. Multiple
This element is used to specify an XPath query. Because XPath queries are executed on an annotated XML Data Reduction (XDR) schema, the schema file name must be specified using the mapping-schema attribute.
sql:xsl
This attribute is used to specify the Extensible Stylesheet Language (XSL) stylesheet that will be applied to the resulting XML document. When specifying a mapping schema file, you can specify a relative or absolute path. The relative path specified is relative to the directory associated with the virtual name of the template type. For example, if the directory associated with the virtual name of the template type is C:\Template, then the relative path Xyz/MyXSL.xml specified for sql:xsl will map to C:\Template\Xyz\MyXSL.xml.
mapping-schema
This attribute is used to identify the annotated XDR schema. Specify this attribute only when performing an XPath query in the template. XPath queries are executed on annotated XDR schemas. When specifying a mapping schema file, you can specify a relative or absolute path. The relative path specified is relative to the directory associated with the virtual name of the template type. For example, if the directory associated with the virtual name of the template type is C:\Template, then the relative path (schema/MSchema.xml specified for mapping-schema) maps to C:\Template\Schema\MSchema.xml.
Description Each
If contenttype is set, Sqlisapi.dll returns header information to the browser. If contenttype is not set, urlmon uses the first character in the template file to determine the content type. If the first character in the template is a < character or the Unicode byte order mark (0xFFFE), text/xml is returned to the browser as the content type, and the browser displays the result. Otherwise, Sqlisapi.dll does not send the content-type header information that instructs the browser how to display the results; therefore, the results will not be visible in the browser.
Before you can specify a template in a URL template, you must create a virtual name of type template using the IIS Virtual Directory Management Utility for SQL Server. For more information, see Using the IIS Virtual Directory Management Utility for SQL Server.
Storing templates
Templates are stored in the directory associated with a virtual name of type template or one of its subdirectories:
If the template is stored in a directory associated with a virtual name of type template , the URL query has the following form:
http://IISServer/nwind/TemplateVirtualName/TemplateFile.xml
If the template is stored in a subdirectory associated with the virtual name of the template type (xyz), the URL query has the following form:
http://IISServer/nwind/TemplateVirtualName/xyz/TemplateFile.xml
Namespaces are not supported for XPath queries specified directly in the URL. If you want to use namespaces in XPath queries, you should use template
The above is the content of using XML templates (MSSQL manual). For more related content, please pay attention to the PHP Chinese website (www.php.cn )!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Can XML files be opened with PPT? XML, Extensible Markup Language (Extensible Markup Language), is a universal markup language that is widely used in data exchange and data storage. Compared with HTML, XML is more flexible and can define its own tags and data structures, making the storage and exchange of data more convenient and unified. PPT, or PowerPoint, is a software developed by Microsoft for creating presentations. It provides a comprehensive way of

Convert XML data in Python to CSV format XML (ExtensibleMarkupLanguage) is an extensible markup language commonly used for data storage and transmission. CSV (CommaSeparatedValues) is a comma-delimited text file format commonly used for data import and export. When processing data, sometimes it is necessary to convert XML data to CSV format for easy analysis and processing. Python is a powerful

How to handle XML and JSON data formats in C# development requires specific code examples. In modern software development, XML and JSON are two widely used data formats. XML (Extensible Markup Language) is a markup language used to store and transmit data, while JSON (JavaScript Object Notation) is a lightweight data exchange format. In C# development, we often need to process and operate XML and JSON data. This article will focus on how to use C# to process these two data formats, and attach

PHP email templates: Customize and personalize your email content With the popularity and widespread use of email, traditional email templates can no longer meet people's needs for personalized and customized email content. Now we can create customized and personalized email templates by using PHP programming language. This article will show you how to use PHP to achieve this goal, and provide some specific code examples. 1. Create an email template First, we need to create a basic email template. This template can be an HTM

Using Python to implement data validation in XML Introduction: In real life, we often deal with a variety of data, among which XML (Extensible Markup Language) is a commonly used data format. XML has good readability and scalability, and is widely used in various fields, such as data exchange, configuration files, etc. When processing XML data, we often need to verify the data to ensure the integrity and correctness of the data. This article will introduce how to use Python to implement data verification in XML and give the corresponding

Regarding PPT masking, many people must be unfamiliar with it. Most people do not understand it thoroughly when making PPT, but just make it up to make what they like. Therefore, many people do not know what PPT masking means, nor do they understand it. I know what this mask does, and I don’t even know that it can make the picture less monotonous. Friends who want to learn, come and learn, and add some PPT masks to your PPT pictures. Make it less monotonous. So, how to add a PPT mask? Please read below. 1. First we open PPT, select a blank picture, then right-click [Set Background Format] and select a solid color. 2. Click [Insert], word art, enter the word 3. Click [Insert], click [Shape]

Jackson is a Java-based library that is useful for converting Java objects to JSON and JSON to Java objects. JacksonAPI is faster than other APIs, requires less memory area, and is suitable for large objects. We use the writeValueAsString() method of the XmlMapper class to convert the POJO to XML format, and the corresponding POJO instance needs to be passed as a parameter to this method. Syntax publicStringwriteValueAsString(Objectvalue)throwsJsonProcessingExceptionExampleimp

How Python parses XML files XML (eXtensibleMarkupLanguage) is a markup language used to represent structured data. When processing XML data, we often need to parse the XML file to extract the required information. Python provides many libraries and modules to parse XML files, such as ElementTree, lxml, etc. This article will introduce how to use Python to parse XML files, with code examples. In Python,
