Viewing Delivery Information

The DeliveryCo Web site isn't fully implemented in the sample application. Its primary purpose is to allow you to easily confirm the insertion of orders into the Deliveries table.

As I mentioned, the site is implemented as a SQLISAPI virtual directory named DeliveryCo, which contains a single template named Deliveries.xml. This template retrieves delivery information from the Deliveries table, as shown here:

 <?xml version="1.0"?> <deliveries xmlns:sql="urn:schemas-microsoft-com:xml-sql"     sql:xsl="Deliveries.xsl">     <sql:query>         SELECT reference, delivery_address          FROM Deliveries delivery for XML AUTO, ELEMENTS     </sql:query> </deliveries> 

The template includes a sql:xsl attribute, which causes the specified style sheet to be applied by the OLE-DB provider on the server before the IIS server sends the results to the browser. This strategy means that the browser receives HTML rather than XML, making this template more suitable for use on the Internet than those that require client-side style sheet processing. To ensure the HTML produced by the style sheet is displayed properly on the client, the URL you use to request the page must include a contenttype parameter, as shown in this example:

 http://localhost/DeliveryCo/templates/deliveries.xml?contenttype=text/html 

The output from the Deliveries.xml template is shown in Figure 9-7.

Figure 9.7 - The DeliveryCo Web site



Programming Microsoft SQL Server 2000 With Xml
Programming Microsoft SQL Server(TM) 2000 with XML (Pro-Developer)
ISBN: 0735613699
EAN: 2147483647
Year: 2005
Pages: 89

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net