ODBC Content Bridge Style Sheets

When you set the Transform Results Table to XML Document to True, the ODBC Content Bridge creates XML documents out of the retrieved record information. The XML that the ODBC Content Bridge generates, like all XML, does not contain information to format and display the document. XML documents use XSL style sheets to format and display its contents. So, to prevent your end users from seeing your ODBC database content as raw XML (not pretty) on your NXT site, you must designate an XSL style sheet to format and display the resultant XML. The Style Sheet properties section provides you with the ability to designate the appropriate style sheet for displaying your database content on your site.

You can designate the appropriate style sheet for rendering your database content on each level that you use the Documents SQL Statement property to retrieve content from your database. You need to use the Style Sheet properties only when you choose to transform your results to XML. The ODBC Content Bridge uses the following properties to insert the appropriate style sheet reference information within each of the XML documents it creates during the build for each given level:

See Levels for more information on creating structure and retrieving content from your ODBC database.

Figure 1. ODBC Content Bridge Properties Window

Style Sheet Reference Type

The Style Sheet Reference Type property provides a drop down list of options you can choose to select which type of style sheet reference to use for this Level. Table 1 lists and describes the options for this property.

Reference Type Description
Empty The Empty option indicates that the ODBC Content Bridge does not associate a style sheet with any XML content that it builds at this level. Therefore, on making a request for XML content at this level, the raw XML is returned. Because the raw XML content is generally not very useful to the end user, you should use this option only while doing development to get a better understanding of the underlying XML content created by the content bridge.
File The File option tells the ODBC Content Bridge to include a style sheet reference element in each of the XML documents it generates on that level. This option also tells the content bridge to include the style sheet in your content collection. So, when the ODBC Content Bridge builds your content collection, it creates a hidden NXT 4 folder called $StyleSheets$ immediately under the root level in the content collection and places the style sheet in that folder. The style sheet reference that the content bridge includes in each of the XML documents "points" to the location of the style sheet within your content collection, not on your server.

Having the content bridge build the style sheet into your content collection enables you to distribute the content collection as a single entity without having to distribution style sheet separately. Use this option primarily when creating content collections for NXT 4 Solo users.
Template The Template option tells the ODBC Content Bridge to include a style sheet reference element in each of the XML documents it generates at that level. However, unlike the File option, the Template option tells the content bridge that the style sheet exists, or will exist, in the NXT 4 server's template folder, but not to build it into the content collection. Use this option instead of File if you want to maintain and modify the style sheet separately from the content collection (without having to rebuild the content collection if the style sheet changes).

This option is advantageous when you are hosting a content collection on an Internet or intranet site and not when distributing the content collection to NXT 4 Solo users.

URL The URL option is similar to the Template option except the reference that the ODBC Content Bridge includes in each XML document is a URL-based reference to a style sheet that is available on an external web server.

As browser manufacturers become more security conscious, they might restrict how well their browsers support this facility. You should use URL only when you can control the browser version being used to access the content and when you can guarantee that all users are able to access the server containing the style sheet.

Table 1. ODBC Content Bridge Reference Type Property Options

Style Sheet Reference

The Reference property holds the location information of the style sheet and helps determine how the ODBC Content Bridge generates references to that style sheet from within XML documents the content bridge generates.

Depending upon the option you choose for the Reference Type property, you can type the reference information in the Reference field (you can also click the button and browse to the location of the style sheet). Table 2 lists the different types of references according to the option you select for the Reference Type property.

Reference Type Value Reference Property Value
Empty The ODBC Content Bridge does not use the Reference property for this option and the content bridge ignores any value you specify.
File The Reference property value for the File option must be the full path to a style sheet file located on your file system. At build time, the content bridge copies this file to a folder in the content collection called /$StyleSheets$. The style sheet reference element the ODBC Content Bridge inserts into the XML documents references the style sheet copy within the content collection not the original style sheet on your server.
Template The Reference property value for the Template option needs only to be the file name of the style sheet. You do not have to specify the complete system path and file name. However, the Template option also requires you to place the style sheet in the templates directory on your server. The style sheet reference within the XML documents points to this file inside the templates directory.
URL The Reference property value for the URL option must be a fully specified URL.

For example,
http://www.mycorp.com/mysite/data/stylesheet1.xsl

Table 2. ODBC Content Bridge Reference Property Options

Style Sheet Content Type

The Content Type property requires you to specify whether the style sheet you reference is a Cascading Style Sheet (CSS) or an eXtensible Stylesheet Language (XSL) style sheet. You must indicate one of these if you fill the Reference Type and Reference properties.

Style Sheet Resource Files

The Resource Files property enables you to identify and include other files that your style sheet references within itself. For instance, if your style sheet references images or a CSS, you can list those files in this property. Click the button to the right of the Resource Files field to access the Edit Style Sheet Resources dialog box in Figure 2.

Figure 2. ODBC Content Bridge Edit Style Sheet Resources Dialog

You can add the necessary additional resource files by clicking the Add file(s) button at the bottom of the dialog box. This will open a window for you to browse to the location of the file. When you find the file and click Open the path and name of the file will be added to the dialog box. When you build this content collection the ODBC Content Bridge will copy those files into the same folder in your content collection as your style sheet.

Typically you will only need to use this property when you set the Reference Type property to File. Otherwise, for the Template and URL options, the supporting files will reside in the same location as the style sheet; either in the templates directory on your server or on the web server, respectively.