SRML - Simple Resource Markup Language

Copyright 2004, Deepnet Technologies

Abstract

This document describes the Simple Resource Markup Language (SRML), a XML language that can describe resources of Windows applications. The goal of SRML is to enable localization of Windows applications at the runtime without the need to modify the application itself.

Table of Contents

  • 0. SRML Element
  • 1. Menu Element
    • 1.1 Menu Item Element
    • 1.2 Menu List Element
  • 2. Dialog Element
    • 2.1 Dialog Item Element
  • 3. String Element
    • 3.1 String Item Element
  • 4. Define Element
    • 4.1 Define Item Element

0. SRML Elements

This section defines the elements of the Simple Resource Markup Language (SRML). SRML defines a small number of elements and attributes for describing structures, properties, and layout of resources of Windows applications.

There are four top-level elements in SRML, namely Menu, Dialog, String and Define element.

The root element in a SRML document is the SRML.

<!ELEMENT SRML (Menu | Dialog | String | Define)* >
<!ATTLIST Language Codepage Encoding Author Date Version>

Attributes:

Language -Specifies the name of the language used in this document
Codepage -Specifies the Window’s codepage number of the language
Encoding -Specifies the encoding format used in this document

Example:

<srml language=”Chinese” codepage=”936” encoding=”gb2316”>

1. The Menu Element

The Menu element defines a menu.

<!ELEMENT Menu (Menu | Item | List)* >
<!ATTLIST ID Label Tip InsertBefore InsertAfter>

Example:

Attributes:

ID-Specifies the ID of the menu. Each menu must have a unique ID
Label-Specifies the text label of the menu
Tip-Specifies the tool tip of the menu
InsertBefore-Specifies the location of the menu if the menu is a sub-menu
InsertAfter-Specifies the location of the menu if the menu is a sub-menu

1.1 The Menu Item Element

The Item element in a menu defines a menu item.

<!ELEMENT Item>
<!ATTLIST ID Label Tip InsertBefore InsertAfter>

Attributes:

ID-Specifies the ID of the menu. Each menu must have a unique ID
Label-Specifies the text label of the menu item
Tip-Specifies the tool tip of the menu item
InsertBefore-Specifies the location of the menu item
InsertAfter-Specifies the location of the menu item

1.2 The Menu List Element

The List element in a menu defines a placeholder for a dynamically generated sub-menu. A list is provided by a separate XML document on demand.

<!ELEMENT List>
<!ATTLIST ID>

2. The Dialog Element

The Dialog element defines a dialogue box.

<!ELEMENT Dialog (Item)* >
<!ATTLIST ID Caption Position Size>

Example:

Attributes:

ID-Specifies the ID of the dialogue box. Each dialogue box must have a unique ID.
Caption -Specifies the caption or title of the dialogue box
Position-Specifies the screen position of the dialogue box on the screen. The position is a pair of “x, y” coordinates
Size -Specifies the size of the dialogue box. The size is expressed in a pair of “width, height” value.

2.1 The Dialog Item Element

The Item element in a dialog defines a control. The control can be any control that is allowed in a dialogue box, such as a static text, a edit box or a list box.

<!ELEMENT Item>
<!ATTLIST ID Label Position Size>

Example:

Attributes:

ID-Specifies the ID of the item. Each item must have a unique ID
Label-Specifies the text label or title of the control
Position-Specifies the position of the control within the dialogue box. The position is a pair of “x, y” coordinates
Size -Specifies the size of the control. The size is expressed in a pair of “width, height” value.

3. The String Element

The String element defines a string table that can contains a number of text strings.

<!ELEMENT String>

3.1 The String Item Element

The Item element in a string table defines a text string.

<!ELEMENT Item>
<!ATTLIST ID Value>

Example:

Attributes:

ID-Specifies the ID of the item. Each item must have a unique ID.
Value-Specifies the text value of the string

4 .The Define Element

The Define element defines a map table of IDs that have been used in the application.

<!ELEMENT Define>

4.1 The Define Item Element

The Item element in a define table defines a ID.

<!ELEMENT Item>
<!ATTLIST ID Value>

Example:

Attributes:

ID-Specifies the ID of the item. Each item must have a unique ID.
Value-Specifies the internal value of the item.