Configuring XML

If you use the XML or XHTML Web DataWindow, you can use the properties of the XmlConfigurations class to fine-tune the way the XML and XHTML are generated.

XHTML export templates

The XSLT stylesheet that transforms the DataWindow content to XHTML can be customized by applying a custom XHTML export template to the default generation. The CSS stylesheet can be customized by applying custom style attributes in a custom XHTML export template. Using stylesheets to target the presentation enables the DataWindow to be rendered on virtually every device. The TemplateName property specifies this template. If any templates have been defined, they display in a drop-down list in the Properties window. For more information, see Chapter 11, “Working with XHTML Templates.”

URL for dynamically created files

The XmlConfigurations.UrlPath property specifies the physical directory where dynamically created files are saved. This includes .css, .js, .xml, and .xslt files. If you specify a value for XmlConfigurations.UrlPath, it overrides the values for PublishPath and ResourceBase set in DataWindow Designer.

If you want to specify different paths for each of the different file types or if you want to specify a full path, set the properties in DataWindow Designer and leave the XmlConfigurations.UrlPath property empty in Visual Studio .NET. For more information about the properties you can set in DataWindow Designer, see “XML Web DataWindow generation properties”.

NoteWrite permission for directories for generated files When you specify a path for dynamically generated files, make sure that the ASP.NET account (or, for Windows 2003 server, the IIS_WPG user group) has write permission to the directories. For more information, see the Microsoft documentation.

NoteYou must delete files manually If you do not set these properties in DataWindow Designer or in DataWindow .NET, the files are saved in the current Web application’s root directory.

You must set up a mechanism for deleting dynamically generated files, whether or not they are saved to a specified path. Saving them in a directory makes it easier to delete them.

Generating files for specific clients

If you use dynamic DataWindow objects customized for specific clients, you can force the generation of the names of these files to be specific to each client. You do this by setting the SessionSpecific property to true. This eliminates the possibility of server-side contention for presentation formats when the DataWindow generation is specific to the client. The default value is false.

Generating XML inline for security

The XML published on the Internet in your XML Web DataWindow could contain sensitive data, and this data might be exposed to Internet users when published to a separate document. For increased security, if the SecurelyInline property to set to true, the XML is generated “inline” to the XSLT transformation script in the page that renders the control. If only authenticated users have access to this script, the security of the XML is ensured. Setting this property should have no adverse side effects on the caching efficiency of the control. The default value is false.