What Is a Template?

I described XML templates in Chapter 3. A template is an XML document based on the Microsoft XML-SQL namespace. When you use templates with HTTP, you can store the template file in a virtual name of template type and access the file by specifying the template name in a URL. For example, a template namedproducts.xml saved in a virtual name known as onlinesales could be accessed using a URL similar to this one:

 http://webserver1/northwinddata/onlinesales/products.xml 

You create the virtual name of template type by using the Configure SQL XML Support In IIS MMC snap-in tool or the automation objects for virtual directory management, as described in Chapter 4. A single virtual directory can contain many virtual names, so it’s up to you to decide how to arrange your templates. You might want to create multiple virtual names to reflect different types of data. For example, in an intranet application, you might choose to create a set of templates that deal with employees and place the templates in one virtual name while you store templates relating to customers in a different virtual name. You can also store templates in subdirectories of virtual names and extend the URL used to access the templates accordingly.

To use templates, you must configure the virtual directory to allow template queries. You accomplish this by selecting Allow Template Queries on the Settings tab of the Virtual Directory Properties dialog box in the Configure SQL XML Support In IIS MMC snap-in tool or by setting the AllowFlags property of the SQLVDir object to 8.



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