How To Retrieve XML Data by Using a Template File in an ASP Client (272266)
The information in this article applies to:
- Microsoft Active Server Pages
- Microsoft SQL Server 2000 (all editions)
- Microsoft XML 2.6
This article was previously published under Q272266 SUMMARY
The following sample demonstrates how to run a SQL 2000 template file while specifying an XSL file to transform the XML data. More specifically, a query is issued against SQL Server 2000 by using the command stream of ADO 2.6: This query fetches the XML datastream.
This sample reads the template file products.xml from disk and sets the command text for the ADODB.Command for the query to run. Properties that are set for the Properties collection of the ADODB.Command include Base Path, Output Stream, Dialect, and XSL:
- Base Path establishes the location where the template and the XSL files reside.
- Output Stream designates where the resulting XML data stream will be piped.
- The Dialect defines the syntax and the general rules that the provider uses to parse the string or the stream. When you set the command language dialect, this specifies how the Microsoft OLE DB provider for Microsoft SQL Server interprets the command text that is received from ADO. The dialect is specified by a globally unique identifier (GUID) and is set by using the Dialect property of the Command object.
- You use the XSLT file name and the location to process the output XML stream.
NOTE: The Output Stream may be any object that supports an IStream or ISequentialStream interface. Objects that support the IStream interfaces are the ADODB.Stream, IIS5 Response object, and an MSXML DomDocument.
Finally, the sample also sets the XSL setting in order to transform the XML document.
REFERENCES
For more information about SQL 2000, please see SQL Server Books Online.
For more information on XML, please see the following Web sites:
Modification Type: | Minor | Last Reviewed: | 11/22/2005 |
---|
Keywords: | kbhowto KB272266 |
---|
|