Data Model > UNICOM Intelligence Data Model accessories > Questionnaire Viewer > Customizing the Questionnaire Viewer
 
Customizing the Questionnaire Viewer
You can customize the Questionnaire Viewer; for example, to change colors, fonts, and font sizes. You do this by changing parameters in the file named mdd.xslt. By default, this file is installed into [INSTALL_FOLDER]\IBM\SPSS\DataCollection\<version>\Accessories.
Alternatively, you can create a new mdd.xslt file and place it in the folder that contains the questionnaire definition file that you want to view. This file is then used when the Questionnaire Viewer displays the questionnaire definition.
The Questionnaire Viewer is based on Extensible Style sheet Language for Transformations (XSLT) technology. XSLT is a standard language for transforming XML documents into other formats. The Questionnaire Viewer uses this technology to transform the questionnaire definition, which is in XML format (even though it has a filename extension of .mdd), into HTML.
The transformation is based on styles that define the format of the different elements in the questionnaire. You change the appearance of the various elements by changing the styles in the mdd.xslt file. For example, the formatting of information items in the questionnaire is controlled by the info style. By changing the definition of the info style you can change the appearance of the headings, greetings, and other information items when the questionnaire is displayed in the browser.
Two sets of styles are defined in mdd.xslt. The first defines the formats to be used when the questionnaire is displayed in the browser, and the second defines the formats to be used when you print a questionnaire from the browser. For example, by default, the same font (Verdana) is used for both displaying and printing the questionnaire. But, you can optionally specify that a different font (such as Times New Roman) is used when the questionnaire is printed.
The styles are defined using standard cascading style sheet (CSS) definitions. For more information on CSS and XSLT, refer to standard CSS and XSLT documentation.
To customize the Questionnaire Viewer
1 Open the file mdd.xslt in a text editor, such as Notepad.
This is what the start of the default file looks like:
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:mdm="http://www.spss.com/mr/dm/metadatamodel/Arc 3/2000-02-04">
<xsl:template match="/">
<html charset="UTF-8">
<style>
body
{
background-color: steelblue;
font-family: Verdana;
overflow: hidden;
margin: 0;
border: none;
color: white;
padding: 0;
}
.background
{
padding: 20px;
background-color: gray;
border: none;
overflow: auto;
height: 100%;
width: 100%;
color: black;
border-bottom: 1 solid steelblue;
border-top: 1 solid darkblue;
}
The <style> tag near the top of the file marks the start of the styles that define the format of the various elements in the browser. Further down is a <style media="print"> tag, which marks the start of the styles that define the format of the various elements when you print the questionnaire from the browser.
2 Change the styles as required.
3 Save the file.
See also
Questionnaire Viewer styles
Using Questionnaire Viewer with Word
Questionnaire Viewer styles
Customizing the Questionnaire Viewer: Example
Questionnaire Viewer