Using the XML template is the general form of template, showing how to specify SQL queries and XPath queries:
Any elements in the template are optional. Elements
Specify this tag to provide a single top element (also known as root mark) for the resulting XML document. The
This tag is used to save all titles values. In the current implementation, you can only specify
This element is used to define parameters that are passed to the query within the template. Each element defines a parameter. Multiple elements can be defined in the
This element is used to specify SQL queries. Multiple
This element is used to specify the XPath query. Because the XPath query is executed on the XML data simplification (XDR) schema with annotation, the architecture file name must be specified using the mapping-schema feature.
SQL: XSL
This feature is used to specify the extensible style sheet language (XSL) style sheet that will be applied to the resulting XML document. When specifying a map architecture file, you can specify a relative or absolute path. The specified relative path is a directory associated with a virtual name with the template type. For example, if the directory associated with the Template type virtual name is C: / Template, the relative path XYZ / MyxSl.xml specified for SQL: XSL will be mapped to C: /Template/xyz/myxsl.xml.
Mapping-schema
This feature is used to identify the XDR architecture with annotation. This feature is only specified when the XPath query is executed in the template. XPath Query is executed on the XDR architecture with annotation. When specifying a map architecture file, you can specify a relative or absolute path. The specified relative path is a directory associated with a virtual name with the template type. For example, if the directory associated with the Template type virtual name is C: / Template, the relative path (schema / mschema.xml specified for mapping-schema) is mapped to C: /Template/schema/mschema.xml. Note Each
If contentType is set, Sqlisapi.dll returns the title information to the browser. If CONTENTTYPE is not set, URLMON determines the content type using the first character in the template file. If the first character in the template is the You must use the IIS Virtual Directory Administrative Utility for SQL Server to create a virtual name for the IIS virtual directory management utility for SQL Server before specifying a template. For more information, see Using the IIS Virtual Directory Administration utility used for SQL Server. The storage template template is stored in a directory associated with the Template type of virtual name or one of its subdirectories: If the template is stored in a directory associated with the Template type, the URL query is as follows: http://iisserver/nwind/templatevirtualname/templatefile.xml If the template is stored in a subdirectory associated with the virtual name (XYZ) virtual name, the URL query is as follows: http://iisserver/nwind/templatevirtualname/xyz/templatefile.xml Specifies the XSL style table in the template Query results apply Scalable Style Sheet Language (XSL) style sheet. When using the HTTP to perform the template, you can specify the XSL file with the following method: Use SQL: XSL feature in the template. Use the XSL keyword as part of the URL to specify the XSL file that will be used to process the resulting XML data. If you use SQL: XSL to specify the XSL file in the template and use the keyword XSL to specify the XSL file in the URL, first apply the result to the XSL style sheet specified in the template and then applied to the XSL file specified in the URL. Example In the following example, NWind is a virtual directory created using the IIS Virtual Directory Management utility for SQL Server. Template is a virtual name for the template type defined when creating a virtual directory (you can specify any virtual name for it when you create a virtual directory. ). For more information, see Using the IIS Virtual Directory Administration utility used for SQL Server. A. Specify SQL: XSL in the template to handle the results in the following example, the template contains a simple SELECT statement. Follow the instructions in the XSL file specified by SQL: XSL to process query results. XML Version = '1.0' Encoding = 'UTF-8'?> Here is the XSL file: XML version = '1.0' encoding = 'utf-8'?>