Sample Data Interface Definition

How to escape lists in data

If you want to load data which includes a definition list (<dl> </dl>) or an ordered (<ol> </ol> or unorder list (<ul> </ul>), you need to escape the data using the tags <wst> </wst> to prevent these list tags from interfering with parsing of the data structure.

Any text between the <wst> </wst> tags will be passed through to the template unchanged (except for transforming Unicode escape sequences). See the fourthAttribute below for an example.

When the Programmer uses WebStringTemplate to output a Data Interface Definition file, <wst> </wst> are automatically inserted around every data item so that the data strings will be read back in exactly as output.

When editing the Data Interface Definition file by hand, if you ever need to put the character sequence </wst> into a data item then use the character sequence \u003C/wst> instead. Due to the Unicode escape encoding used for non ISO-8859-1 characters, you need to escape any \ characters by replacing them with \\ when editing by hand. Both the </wst> and the \ escaping is done automatically when WebStringTemplates is used to output a Data Interface Definition file.

All text outside the map is ignored

All this text is ignored. Typically you would put explanatory notes about the attributes here. Although you are encouraged to use attribute comments in the data to document the data.

You should be able to edit this data page with a HTML editor, provided it respects the nested lists. OpenOffice V1.1.0 does not. Amaya V8.2 does.

The following horizontal rule is not required. It is just for looks. The data definition follows.

This is the overall comment for the data map. This map provides some examples of the data structure and the use of comments and escapes.
Attribute names are coloured blue bold by the default style sheet.
Single values (like this one) are coloured black by the default style sheet.
A list of elements.
List values are coloured green italic by the default style sheet.
  1. element one
  2. element two
A map with two entries. (Note: .Comment is OK for comments as case is ignored)
A list containing a mixture of elements and maps
  1. element one
  2. list.comment
    A list inside a map inside a list
    Attribute names are coloured blue italic when they are part of a list element.
    1. element one
    2. element two
    3. element three
    This item value is a few spaces in this file.
    When data is loaded, leading and trailing whitespace is removed, so this data will be trimmed to an empty string.
    The item looks empty and is loaded as empty.
    On the other hand this item value is &nbsp;
    It does not look empty and is not. The &nbsp; will be loaded unchanged.
  3. element three
The second entry in the map
second Value
The third attribute in the main map
It contains two lists
  1. element one
  2. element two
  3. element three
  1. element one
A paragraph of pre-formatted HTML text using <wst> </wst> to escape list tags

Here is an example of an escaped list that is loaded as data

  • item one
  • item two

Here is an example of pre-formatted HTML code in the data.

Next paragraph of text. Now a line break
next line some bold and italics.

The above horizontal rule is just for looks. It is not required for the map.

This text is also ignored.