simputer logo simputer mission simputer  
 
 
Simputer:
­ Spec
IML:
· Abstract
Information Markup Language (IML) 2.0 Specification

IML 2.0 Specification

Introduction

IML 2.0 is a significant revamp of IML 0.8, with fully integrated support for SmartCards, multi-lingual text and text-to-speech synthesis, event-based dynamic content and integration with backend scripting, colour and other powerful features. The compactness and power of IML 2.0 is designed to encourage creation of browsers in several languages and platforms.

The detailed specification of all the elements and attributes of IML 2.0 are given below. Notes have been added to aid browser implementors. The examples illustrate the form and structure of IML 2.0. A tutorial (under construction) and a reference browser (under construction) illustrate the potential of IML 2.0.

Status of this specification

IML 2.0 is expected to remain stable with possible minor changes based on browser implementation experience.

Contributors

Swami Manohar
Anirudh Moudgal
Sunil Nagaraj
Vivek K Srikantan
Rajat Venkatesh
V. Vinay

Elements

<iml>

A self-contained IML document for the browser to render.
Contained in: None.
Can Contain: <box>, <page>, <turn>, <update>, <refresh>,<set>, <delay>,<code>
Attributes:
  • id - used for updates
  • lang -"english"(default)|"hindi"|"kannada"|"tamil"|"telugu". The language to apply to the IML document. Overridden by more local specifications of 'lang' in <page>, <text>, <list> etc.
  • title - The title of the document.
  • foreground, background - foreground and background colours of the IML document; can be overridden by colours in a <box> or a <page>
  • image - (file path to ) image to be used by all pages as background; can be be overridden by images in a <box> or a <page>

Notes

The title of the document is used to present a list of recently opened IML documents in the browser, so that users can switch between them. The title is rendered in the language of the IML document.

Examples

A typical IML document begins like
<iml id="hgtg" title="Hitchikers Guide to the Galaxy" lang="english"> 
.
<!-- many pages -->
.
.
.
</iml>

<box>

A container for text or image content to be displayed. Allows content creator a great degree of control over layout of information on a page.
Contained in: <iml>, <page>
Can Contain: none
Attributes:
  • id - used for updates
  • name - Name of this box. <text> , <canvas> and <label> content use this name to indicate the box to be displayed in.
  • type - "text"|"canvas"|"table"|"label"|"container".
  • xoff, yoff - X and Y offsets of this box, in pixels. These attributes are used when you want tables with different sized rows and columns. xoff=0, yoff=0 is at the top left corner of the screen.
  • width, height : When using xoff, yoff , the width and height of the box. It is recommended that one use xoff,yoff, width and height attributes for boxes that are not tables. For boxes that are tables, use (coords, rowheights, colwidths) or (rows, cols).
  • coords - x1,y1,x2, y2. Space or comma separated pixel values that define the dimensions of a box.
  • rowheights, colwidths - Row and Column width when this box is a table, specified as space or comma separated values.
  • rows, cols - Number of rows and columns in the table. Use when you need tables of unisized cells.
  • border - Inter-cell spacing in a table-type box . The default border width is 1.
  • outline - "yes"|"no". Tables are by default outlined, plain boxes are not.
  • caption - A brief label; used to decorate the box.
  • lang -"english"(default)|"hindi"|"kannada"|"tamil"|"telugu". The language of the caption.
  • foreground, background - Foreground and background colours of the box.
  • image - (file path to) image to be used by box as background.
  • overflow - name of the box that the content of the current box has to overflow into. If the box to overflow into is not found on the current page, then a box with the same name is sought in the next page. To enable this search for a box on the next page, prefix the overflow value with a "+".
  • hide - "true"|"false"; determines whether this widget must be shown or not.

Notes

Content marked up inside a <page> is associated with a box of a given name. A <box> under <page> takes precedence over a <box> of the same name defined under <iml>.

If the rowheights or colwidths are larger than the box defined by coords, then values of these attributes overrides values provided in "coords".

Examples

Here is a box that is placed at 10,10 (the top left corner of the screen being (0,0)) and is 100 pixels wide and 120 pixels in height. It has its background and foreground in different colours (yellow and black). Only <text> can be placed in this box:
<box name="message" type="text" xoff="10" yoff="10" width="100" height="120" background="#ffff00 foreground="#ffffff"/>
This box can contain only <canvas> content. Instead of using xoff,yoff, width and height, a boxes coordinates can be specified as coords (either space or comma separated pixels value):
<box name="drawings" type="canvas" outline="yes" coords="10,15,100,100"/>
Tables can have any - <text>, <label> or <canvas> - type of content . There are different ways to specify a table's dimensions and the number of rows and columns in it.

In this box, a rectangle of 100×100 is uniformly split up into 5 rows and 2 columns, with 2 pixels between the cells.

<box name="uniform_box" type="table" coords="10,15,100,100" rows="5" cols="2" outline="no" border="2"/>
To get more control over the size of the rows and columns, use rowheights and colwidths (either space or comma separated pixel values). In this table, there are two rows, the first 20 pixels in height, and the other 35 pixels. There are three columns, the first is 15 pixels wide, and the next two are 25 pixels each. Since the row heights and column widths are specified, we do not need to provide the bounding coords as in the previous examples. Only the starting X and Y offsets will do.
<box name="flexi_box1" type="table" xoff="5" yoff="5" rowheights="20 35" colwidths="15 25 25"/>
You can mix rows,cols and rowheights,colwidths. In the next example, the first table has the column widths explicitly specified and the row heights are calculated by the browser, given the overall height. In the second table, the row heights are explicitly provided whereas the column widths are calculated by the browser, given the overall width. Both tables have 2 rows and 3 columns.
<box name="flexi_box2" type="table" xoff="5" yoff="5" rows="2" colwidths="15 25 25" height="100"/>
<box name="flexi_box3" type="table" xoff="5" yoff="5" rowheights="20 35" cols="3" width="90"/>

<page>

The basic, logical unit of IML document.
Contained in: <iml>
Can Contain: <box>, <text>, <canvas>, <label>, <update>, <refresh>, <set>, <delay>,<smartcard>,<container>
Attributes:
  • id - Handle to a page, used as targets of links.
  • lang - "english"(default)|"hindi"|"kannada"|"tamil"|"telugu". Language the page has to be rendered in and content synthesised to speech. Overrides 'lang' value of any parent tag.
  • title - Title of the page. Displayed by the browser at the top of a page.
  • speak - "_this" speaks the title of the page, or the content explicitly given as the value.
  • audiomode - "itrans"(default)|"raw"|"tts"|"mp3"
  • audiofile - path of the file to be played
  • audiolang - "english"(default)|"hindi"|"kannada"|"tamil"|"telugu". The language/voice in which the contents of speak is to be synthesised in, if different from the language used to visually render the content.
  • role - When navigating IML content through the browser's navigation buttons, a page is displayed if its given role, matches the current role of the document. The value of a page's role can be any character data. The current role in the document can be changed using <set>.
  • foreground, background - foreground and background colours of the page; overrides colours specified at <iml> level
  • image - (file path to ) image to be used by this pages as background; overrides images specified at <iml> level
  • hide - "true"|"false"; determines whether this widget must be shown or not

Notes

In the absence of a page title, the document's title is shown (see <iml>). In the interests of usability, it is recommended that content developers do not put a title on the first page of a IML document (so that the document title is shown). Subsequent pages should have a helpful title.

If the speak attribute is not used then the browser should speak out the title of the IML document.

Examples

A page segment contains textual or graphical content, and perhaps tags that change the content.
<iml id="hgtg" title="Hitchikers Guide to the Galaxy" lang="english">

<page id="cover">
</page>

<page id="preface" title="Preface" speak="_this">
</page>
.
.
<page id="1">
</page>
.
.
<page id="128">
</page>
.
<page id="243" lang="hindi">
</page>
.
.
</iml>
For what it is worth, the 243rd page of the document will be rendered in Hindi instead of English as the rest of the document.

Also note, the first logical page of the document (in the sequence of <page> segments ) is the page with id="cover" and has not been given a title. This allows the title of the document to be shown the first page. The second page, id="preface" has a title="Preface".


<label>

A simple text element, used mainly for small text segments. Labels cannot be formatted (bold, italics etc.). The recommended use for labels is in pages with many data input elements (see - <input>), i.e. forms.
Contained in: <page>
Can Contain: None
Attributes:
  • id - used for updates
  • box - <box> name where this element has to be displayed; <label> elements are placed in box of type 'label' or 'table'.
  • row, col - If the label is to be displayed in is a table-type box, then the row and column of that table.
  • caption - caption for the box the label is to be displayed in.
  • lang - "english"(default)|"hindi"|"kannada"|"tamil"|"telugu". Language the label has to be rendered in and content synthesised to speech. If 'lang' is specified, overrides 'lang' value of any parent tag.
  • anchor - A target page. The target page could be a page in the current IML document, or an external one. A target is specified by the path to the IML document and a page id, the page id preceded by a "#".
  • channel - Reusable connection to a backend script.
  • moveto - "prevdoc"|"nextdoc"|"prev"|"next"
  • speak - "_this" speaks out the label in the specified language. If anything else needs to be spoken out, provide the content in iTrans.
  • audiomode - "itrans"(default)|"raw"|"tts"|"mp3"
  • audiofile - path of the file to be played
  • audiolang - "english"(default)|"hindi"|"kannada"|"tamil"|"telugu". The language/voice in which the contents of speak is to be synthesised in, if different from the language used to visually render the content.
  • hide - "true"|"false"; determines whether this widget must be shown or not

Notes

A label cannot simultaneously have an anchor, channel or moveto associated with it. When it has even one of these, it cannot also be speakable. See <audio> to get around this problem.

Do not use speak and audiofile simultaneously.

Examples

In the following example, a label is placed in a box. The label can also be spoken out.
<iml>
<box name="header" type="label" coords="0 0 45 35/> 
<box name="body" type="text" coords="0 40 100 100"/>

<page id="1">
<label box="header" speak="_this">Table of Contents</label>
.
.
.
</page>

</iml>

<text>

Textual information. Can be formatted, audio-annotated and contain hyperlinks.
Contained in: <page>
Can Contain:<list><input> <b> <i> <u> <s> <br> <large> <small> <link>, <update>, <refresh>, <set>, <delay>,<audio>, <alphanum>
Attributes:
  • id - used for updates
  • box - The name of the box in which the enclosed text is to be displayed.
  • row,col: If the text is to be displayed in is a table-type box, then the row and column of that table.
  • caption - caption for the box the text is to be displayed in.
  • align - 'left'|'center'|'right'|'justify'; alignment within a box. "justify" aligns text to both the left and right margins.
  • lang - "english"(default)|"hindi"|"kannada"|"tamil"|"telugu". Language the text has to be rendered in and content synthesised to speech. If 'lang' is specified, overrides 'lang' value of any parent tag.
  • speak - "_this" speaks out the enclosed text. If anything else needs to be spoken out, provide the content in iTrans. The text is spoken out in the language specified for the text.
  • audiofile - path of the file to be played
  • audiomode - "itrans"(default)|"raw"|"tts"|"mp3"
  • audiolang - "english"(default)|"hindi"|"kannada"|"tamil"|"telugu". The language/voice in which the contents of speak is to be synthesised in, if different from the language used to visually render the content.
  • foreground, background - foreground and background colours of the text.
  • hide - "true"|"false"; determines whether this widget must be shown or not

Notes

A portion of text that is a link (see <link>) to another page cannot also simultaneously be speakable, i.e. have a speak value. See <audio> to get around this problem.

Do not use speak and audiofile simultaneously. When using "_this" to speak out the contents of the tag, the results are unpredictable when <text> contains any child-tags (with or without their own speakable content).


<link>

A hyperlink.
Contained in <text> <large> <small> <i> <b>, <u> <s>, <item>
Can Contain: None.
Attributes:
  • label - The link text to be displayed. Use iTrans for non-english links.
  • id - Handle to this link used in updates.
  • lang - "english"(default)|"hindi"|"kannada"|"tamil"|"telugu". Language the link has to be rendered in and content synthesised to speech. If 'lang' is specified, overrides 'lang' value of any parent tag.
  • anchor - Target of page of this hyperlink. The target page could be a page in the current IML document, or an external one. A target is specified by the path to the IML document and a page id, the page id preceded by a "#".
  • channel - Reusable connection to a backend script.
  • moveto - "prevdoc"|"nextdoc"|"prev"|"next"
  • speak - "_this" speaks out the enclosed text. If anything else needs to be spoken out, provide the content in iTrans. The text is spoken out in the language specified for the text.
  • audiomode - "itrans"(default)|"raw"|"tts"|"mp3"
  • audiolang - "english"(default)|"hindi"|"kannada"|"tamil"|"telugu". The language/voice in which the contents of speak is to be synthesised in, if different from the language used to visually render the content.
  • audiofile - path of the file to be played
  • hide - "true"|"false"; determines whether this widget must be shown or not

Notes

A link cannot simultaneously have an anchor, channel or moveto associated with it. When it has even one of these, it cannot also be speakable. See <audio> to get around this problem.

Do not use speak and audiofile simultaneously.


<list>

List of items. Contained in <text>, <list>
Can Contain <item>,<list>
Attributes:
  • id
  • type: "bulleted" or "numbered"
  • start - For numbered lists, an integer to start counting from.
  • hide - "true"|"false"; determines whether this widget must be shown or not

Examples

Here is a simple, bulleted list:
<list type="bulleted">
<item>Blue</item>
<item>Red</item>
</list>
Numbered lists start counting from 1, but can be made to count from any other positive integer.
<list type="numbered" start="5">
<item>Yellow</item>
<item>Green</item>
<item>Purple</item>
</list>
A list can contain another list, numbered or bulleted:
<list type="bulleted">
<item>Yellow</item>
<item>Green</item>
<list type="numbered">
    <item>Light Green</item>
    <item>Bottle Green</item>
</list>
<item>Purple</item>
</list>

<item>

An item in a list.
Contained in <list>,
Can Contain:<audio>, <link>, <input>, <alphanum>, <u> <s>, <link>, <large> <small> <i> <b>, <u> <s>, <br>
Attributes:
  • id - ID for subsequent updates
  • lang - Language of the item; if not specified inherited from its parent container
  • anchor - Makes the contents of this item an anchor to the given target.
  • channel - Reusable connection to a backend script.
  • moveto - "prevdoc"|"nextdoc"|"prev"|"next"
  • speak - The audio-annotation for this list item
  • audiomode - "itrans"(default)|"raw"|"tts"|"mp3"
  • audiofile - Path of the file to be played
  • audiolang - "english"(default)|"hindi"|"kannada"|"tamil"|"telugu". The language/voice in which the contents of speak is to be synthesised in, if different from the language used to visually render the content.
  • hide - "true"|"false"; determines whether this widget must be shown or not

Notes

An item cannot simultaneously have an anchor, channel or moveto associated with it. When it has even one of these, it cannot also be speakable. See <audio> to get around this problem.

Do not use speak and audiofile simultaneously.


<input>

Interactive user-input widgets.
Contained in: <text>, <item>
Can Contain: None.
Attributes:
  • id - ID for subsequent updates
  • type - "radio"|"check"|"button"|"text"|"password"|"hidden"
  • lang - "english"(default)|"hindi"|"kannada"|"tamil"|"telugu". The language in which the input widget content has to be rendered. Overrides 'lang' value of any parent tag.
  • var - For radio boxes of a logical group, each input widget has the same var. All other input widgets must have vars unique in the entire IML document.
  • value - Value of the variable associated with the widget
  • anchor - Available for button widgets
  • channel - Reusable connection to a backend script; available for all input widgets
  • moveto - "prevdoc"|"nextdoc"|"prev"|"next"
  • width - Width of text or password widgets, in characters
  • height - Number of lines in a text entry widget (default: 1)
  • label - For buttons, checkboxes and radioboxes.
  • hide - "true"|"false"; determines whether this widget must be shown or not
  • state - "enabled"|"disabled" - enables or disables a widget to take user input

Notes

For a button, its label is displayed on the button face. For others, next to the right of the widget. If you want more flexibility, you can always put the "label" for the widget anywhere around the widget using <label> (recommended) or <text>.

Examples

A multi-line text widget (plain text widgets are single-line by default), and a password field (always single-line)
<input type="text" width="50" height="5" var="note" value="Some text"/>
<input type="password" width="12" var="pwd"/>
A check box; save_tips_on_startup gets the value of show when the checkbox is selected
<input type="check" var="show_tips_on_startup" value="show"/>
A group of radio boxes ( note: the var is the same )
<input type="radio" var="remind_choice" value="daily"/>
<input type="radio" var="remind_choice" value="monthly"/>
<input type="radio" var="remind_choice" value="yearly"/>
A drop-down menu. If label is not used, then the values themselves are displayed in the drop-down menu.
<input type="radio" var="month_choice" 
          label="Jan Feb March Apr May Jun Jul Aug Sep Oct Nov Dec"
          value="1 2 3 4 5 6 7 8 9 10 11 12"/>
A simple button; sends values of remind_choice and show_tips_on_startup to the backend program
<input type="button" label="Done" 
          channel="$remind_choice,$show_tips_on_startup"/>
Hidden input fields; these are used to only store values in variables
<input type="hidden" var="currency" value="rupee"/>

<alphanum>

A widget for fast alpha-numerical data entry. (Experimental! The specification of this tag might change in the future.)
Contained in: <text>, <item>
Can Contain: None.
Attributes:
  • id - id for subsequent updates
  • format - Specifies how the alpha-numerical data is displayed. You can mix three data sets d (0-9), a ('a'-'z') and A ('A'-'Z') and punctuation characters to define the visual format of the widget.
  • var - Variable to hold the current value set through the widget. The value is devoid of all formatting.
  • value - Initial value to be displayed. Should be unformatted, and have a match for each d, a or A in the format. If no initial value is given or the initial value does not match the format, then each counter in the widget is filled with its default value ('0', 'a' or 'A').
  • hide - "true"|"false"; determines whether this widget must be shown or not

Examples

For example, "d,dd,ddd.dd" will give you a widget with five numbers to the left of decimal point shown with commas, and two digits to the right of the decimal point. A valid initial value would be "10050099". This would be displayed as "1,00,500.99". The given value is aligned with the format from right to left, with defaults filling any empty place holders.
<alphanum id="cust_balance" format="d,dd,ddd.dd" var="balance" value="10050099"/>
You can mix alphabets and numbers:
<alphanum id="number_plate" format="AA-dd:dddd" var="regn" value="KA091234"/>

<u> <s>

Underline, Strike-through - text formatting tags.
Contained in: <text>, <large> <small> <i> <b>, <item>
Can Contain :<large> <small> <i> <b>, <link>,<br>
Attributes:
  • id - Used to refer content in updates.
  • hide - "true"|"false"; determines whether this widget must be shown or not

<large> <small> <i> <b>

Italics, Bold - text formatting tags.
Contained in: <text>, <u> <s>, <item>
Can Contain: <u> <s>,<link>, <br>
Attributes:
  • id - used to refer to the content during updates
  • hide - "true"|"false"; determines whether this widget must be shown or not

<br>

Inserts new line.
Contained in: <text>, <item>, <u> <s>, <large> <small> <i> <b>
Can Contain: None
Attributes: None.

<canvas>

Logical container for <draw> objects.
Contained in: <page>
Can Contain: <draw>, <update>, <refresh>, <set>, <delay>
Attributes:
  • id - Used to refer to this canvas in updates.
  • box - Name of the box for this canvas to be displayed in.
  • row,col - If the canvas is to be displayed in is a table-type box, then the row and column of that table.
  • caption - caption for the box the canvas is to be displayed in.
  • xy - Space or comma separated x,y value; used to setup storage of the coordinates of the most recent tap on the canvas.
  • xoff,yoff - The X and Y offsets at which the content should start getting rendered.
  • hide - "true"|"false"; determines whether this widget must be shown or not

Notes

The width and height of this canvas are inherited from the box in which it is placed.

In the special case of <canvas>, and internal variable XY is maintained that holds the x.y coordinates of the last tap on the canvas. This is available as a variable for <event>, and the variable name is (canvas-id).XY.


<draw>

Shapes and text drawn inside a canvas.
Contained in: <canvas>
Can Contain: None.
Attributes:
  • id - ID used for later updates
  • type - "text"|"line"|"rectangle"|"oval"|"polygon"|"arc"|"image"
  • coords - Space or comma separated list of x,y coordinates. "coords" for different draw type have different meanings
    • text : Starting coordinates
    • line : Start and end coordinates
    • rectangle : Top-left and bottom-right coordinates
    • oval : Top-left and bottom-right coordinates of the bounding rectangle
    • polygon : Space or comma separated list at least 3 pairs of x,y coordinates
    • arc : Top-left and bottom-right coordinates of the bounding rectangle
    • image : x,y point at which the (top-left corner) image will be placed
  • relcoords - Relative coordinates - these are used in exactly the same way as coords, except that the x and y values are added to the current xoff, yoff values of the canvas.
  • text - The text to be drawn
  • lang - "english"(default)|"hindi"|"kannada"|"tamil"|"telugu". The language in which the text has to be drawn.
  • anchor - Makes the draw item an anchor to the given target page.
  • channel - Reusable connection to a backend script.
  • moveto - "prevdoc"|"nextdoc"|"prev"|"next"
  • speak - The audio-annotation for this list item. Use of "_this" as in other tags is not allowed.
  • audiomode - "itrans"(default)|"raw"|"tts"|"mp3"
  • audiofile - Path of the file to be played
  • audiolang - "english"(default)|"hindi"|"kannada"|"tamil"|"telugu". The language/voice in which the contents of speak is to be synthesised in, if different from the language used to visually render the content.
  • src - Path to image file
  • pan - "on"|"off"(default). Images can be set to be grabbed and panned. Even if a single image on the canvas is set not to pan, then no other image can be panned, even if their own pan attribute is explicitly set to "on".
  • zoom - 0|positive integer|negative integer; the factor by which the image has to be zoomed in or out. Zoom factor of 0 resets the image to its original size.
  • drag - "on"|"off"(default). Shapes (lines, polygons, arcs etc.) can be set to be dragged.
  • fill - For rectangles, polygons and arcs, the colour to be used to fill the shape. Colours may be specified as RGB values in hexadecimal or as names of colours - "red", "blue" etc.
  • outline - For lines, rectangles, polygons and arcs, the colour to be used to draw the shape. Colours may be specified as RGB values in hexadecimal or as names of colours - "red", "blue" etc.
  • width - For lines, arcs and polygons, the thickness of the line used to draw them.
  • start, extent - For arcs, if the bounding box is a rectangle then an arc of a ellipse will be drawn, else an arc of a circle will be drawn. If the start and extent (in degrees) are same then either a circle or ellipse is drawn depending on the type of bounding box. If start and extent are not specified then they are defaulted to zero.
  • style - "chord"|"sector"|"arc"; for arcs.
  • stipple - "gray25"|"gray50"|"gray75"
  • dash - Any pattern that is a combination of "." (dot)|"," (comma)|"-" (hyphen)|"_" (underscore)|" "(space). Pattern should not start with space.
  • hide - "true"|"false"; determines whether this widget must be shown or not.

Examples

<draw type="text" coords="10 15" text="Michaelangelo"/>
<draw type="line" coords="10 15 50 50" dash="._."/>
<draw type="rectangle" coords="0 0 35 35" fill="#ff0000" drag="on"/>
<draw type="polygon" coords="5 5 20 20 10 50" outline="#da2c35"/>
<draw type="oval" coords="25 30 45 60" stipple="gray75"/>
<draw type="arc" coords="25 30 45 60" startangle="20" endangle="130" width="2"/>
<draw type="image" src="/images/sunset.gif" pan="on"/>

<audio>

A widget that displays no text but speaks or plays audio content.
Contained in: <text>,<item>
Can Contain: None
Attributes:
  • id - ID used for later updates
  • lang - "english"(default)|"hindi"|"kannada"|"tamil"|"telugu"
  • speak - The audio-annotation for this list item. Use of "_this" as in other tags is not allowed. However, if speakable content of another tag needs to be played, then the tagid that tag prefixed by a '@' may be given as the value.
  • mode - "itrans"(default)|"raw"|"tts"|"mp3"
  • file - path of the file to be played

Examples

Speaks out "Simputer" in a Hindi voice:
<audio lang="hindi" speak="sim{}p{}yUTr"/>
Speaks out whatever could be spoken at a tag whose id is name_field on the current page". All other audio-related attributes are taken from the source tag.
<audio speak="@name_field"/>
Plays the content of a local MP3 file:
<audio mode="mp3" file="/recorded/help/toolbar.mp3"/>

<container>

An external program that can plugged into an IML page.
Contained in: <page>
Can contain: None. Attributes:
  • box - the name of the box (of type "container") in which the external program has to be displayed
  • src - file path to the executable with start-up parameters
  • hide - "true"|"false"; determines whether this widget must be shown or not.

<smartcard>

Contained in: <page>
Can contain: None. Attributes:
  • mode - "read"|"write"|"erase"|"destroy"
  • readpin, writepin - PIN to access the SmartCard

Notes

Some internal variables are set (to 1 or 0) which reflect the status of the SmartCard. These variables - CARD,READ,WRITE and ERASE (upper-case) - are available over the channel and in <event>.

<turn>

Contained in <iml>
Can Contain: None
"channel" provides a way of carrying on an "conversation" between the browser and the backend. When the backend sends back a <turn> (after a dynamically generated <update> or <page> ), it is backend's way of saying that it is now the browsers turn to send back some data.

See also: channel in the Common Attributes section.


<update>

They are means of altering the properties, i.e. attributes of a tag. Updates are not possible for <list>, <br> and <turn> tags.
Contained in: <iml>,<page>,<text>,<canvas>,<event>
Can contain: None
Attributes:
  • tagid - the id of the tag whose attributes are to be modified
  • (attribute) - any attribute of the tag, except id, name, tagid, name, lang, type and type. Updates can be performed only on attributes actually used in a tag (see exceptions below).
  • value - new value to be given to the chosen attribute

Notes

Some attributes of tags are available only through updates:
  • for <iml>, <update tagid="iml1" moveto="#another_page"/>, takes the reader from the current page to "another_page" in the current IML document.
  • for <box>, <update tagid="box1" show="raise"|"lower" ... will either raise or lower the given box (identified by its name) with respect to a an overlapping box.
  • for <text>, <update tagid="t1" text="New Text"/>, replaces the current text of a text section (with id as "t1" in this example"), with "New Text". This can also be done on the text formatting tags such as <b>, <i>, <u>, <s>, <small>, <large>. When updating a <text> segment that encloses other tags, the results of the "text=..." update can be unpredictable. Updating tags within <text> (if any) that in turn do not contain any more tags is safer, and more reliable.
  • for <label>, <update tagid="L1" content="New Label"/> updates the label.
  • for <canvas>, updates can be performed on xoff, yoff (as expected) as well as rxoff and ryoff (relative coordinates). Updates can also be performed using a x,y combination of absolute and relative coordinates.
  • only in the case of <text>, updating the speak attribute will cause the the text to be highlighted and spoken out (without waiting for user-interaction).
All attribute values in updates are evaluated using the browser's Expression Evaluator, except in the case of updates to anchor and channel.

<refresh>

Refreshes a page.
Contained in: <iml>,<page>,<text>,<canvas>,<event>
Can contain: None

<delay>

General-purpose delay. Processing restarts after the delay time.
Contained in: <iml>,<page>,<text>,<canvas>,<event>
Can contain: None
Attributes:
  • time - time in milliseconds

<set>

Means of assigning values to variables.
Contained in: <iml>,<page>,<text>,<canvas>,<event>
Can contain: None
Attributes:
  • var - variable name of a previously defined tag
  • value - value to be assigned to the variable

Notes

An important implicit variable is the current document's role. While using the browsers navigation buttons, only those pages whose role matches with the current document role are shown.

To set the role of a document,
<set var="ROLE" value="some_role"/>

Here "ROLE" is a predefined, internal variable of the browser that can be set. You can set the role of a document any time, and any number of times (the previous role is deleted). You can also add to the current role of the document by
<set var="ROLEADD" value="additional_role"/>

Now pages matching the list of roles so defined will be shown, when navigating the content through the browser's buttons.


<code>

Only one <code> segment can exist per document.
Contained in: <iml>
Can contain: <event>
Attributes:
  • id

<event>

Contained in: <code>
Can contain: <update>, <refresh>, <execute>, <set>, <delay>

Attributes:
  • id -
  • var - the variable or the attribute of a tag (in the latter prefixed by the tag id), a change in which triggers the event
  • cond - the condition that is checked when the event occurs (defaults to 'true')

Examples

Say an input widget is defined as <input type="check" var="choice" value="red">. When this checkbox is selected, the value of variable choice changes to "red". An event that reacts to this change is defined as <event id="choice_sel_evt" var="choice" cond="'true'">. This event section can then have appropriate <update> and <execute> tags. The browser provides some internal state variables whose changes can trigger events. These are documented under appropriate tags in this specification.

Events can also be triggered on the change of attributes. Say there is a box whose caption was originally "Gallery". Say through some <update> this caption was changed to "Picasso". If this change is an event of interest, then <event id="title_change_evt" var="b1.caption" cond="'true'">...<event> is the section in which this change can be processed.


<execute>

Conditional execution through anchor (new connection), channel (reusable connection) or moveto.
Contained in: <event>
Can contain: None. Attributes:
  • anchor - A target page or a program with argument list contacted over a new connection.
  • channel - Reusable connection to a backend script.
  • moveto - "prevdoc"|"nextdoc"|"prev"|"next"

Common Attributes

foreground, background

foreground and background colours of the IML document, page or box. Colours can be specified as RGB values in hexadecimal, e.g. #a56fc1, or colour names such as "red", "blue" etc. as your system allows.

image

(file path to ) image to be used by all pages as background; can be be overridden by images in a <box> or a <page>.

id

An id for a tag is used to identify it for subsequent updates from the backend scripts. (See also var.) An id has to be unique across an IML document.

var

In IML, variables and tags are separate entities. A variable is not an attribute of a tag. The "var" attribute is the name of the variable to which a tag is tied. A var has to be unique across an IML document.

For example,

<input type="check" id="colour_chk" var="usr_pref" value="red"/>
  1. <update tagid="colour_chk" value="red"/>
  2. <set var="usr_pref" value="blue"/>
#1 is a "tag update". It alters the value associated with variable the check box (in this case). Before the <update>, the value "red" would be assigned to "colour_pref" if the user selected the check box. By the update, we are redefining the tag - now the value "blue" will be put in "colour_pref" when the user selects the check box.

#2 is an assignment. The value "blue" is actually assigned to the variable "usr_pref". In this sense <set> simulates the user's selection of the check box.

anchor

Anchors are typically used to take the user to another page. The anchor specifies a target page for the text marked up for linking. If the page is in the present document the anchor value is anchor="#page_id". If the target page is in another IML document then the target is anchor="file_path#page_id" The file_path is relative to the current document. Pages targeted by anchors are shown without regard to the current role of the document and the role of the page.

Anchors can also be used to open a new connection to a backend program. Thus, anchor="script.pl?$arg1,$arg2" sends an argument list to some program.

The argument list, can also have id.attribute values, e.g. anchor="script.pl?$arg1,$arg2,canvas1.xy" (assuming there is a <canvas> with id="canvas1"; note: the $ sign is not used, and the backend receives the value associated with a key called "canvas1.xy" - unless an explicit key is used).

channel

The channel is typically used to update the current page from a backend program. 'channel' is a persistent, reusable data-exchange connection between the browser (front-end) and the back-end script. Through the channel, data in the form of key-value pairs can be sent to the backend, and the backend can then dynamically generate pages or updates and print them back to the browser. For example,(assuming some element in the current page has a var called "name", and another with a var called "age")
 <input type="button" label="OK" channel="cust_name=$name,$age"/>
sends the value of $name with a key "cust_name", and the value of $age implicitly associated with a key called "age". A programmer always has the choice to send data on the channel with only implicitly defined keys. Thus,
 <input type="button" label="OK" channel="$name,$age"/>
will send $name associated with "name" and $age associated with "age". The values can be extracted using the rIML module provided in Perl and C++ with this release. See IML examples for more.

For a one-time connection to a backend program that updates the current page, channel="another_script.pl?$name,$age" can be used. After this program has sent updates, the connection to the original backend program is used.

The argument list in a channel, can also have id.attribute values, e.g. channel="$arg1,$arg2,canvas1.xy" (assuming there is a <canvas> with id="canvas1"; note: the $ sign is not used and the backend receives the value associated with a key called "canvas1.xy" - unless an explicit key is used).

moveto

Navigation buttons provided by the browser allow visiting:
  • previous or next page relative to visited links
  • immediately preceding and following page as implied by the sequence of <page>...</page> in the document.
In the former case, pages are shown regardless of the document's or the page's role. These pages are referred to as "prevdoc" and "nextdoc". In the latter case, only pages matching the current role-list are shown. These are the "prev" and "next" pages. Associating moveto="prevdoc"|"nextdoc"|"prev"|"next" instead of anchor, with text and input widgets allows replicating the browser's navigation within the IML content/application.

speak

The "speak" attribute specifies the audio annotation for the enclosing content.
  • speak="something" will cause the "something" to be spoken out when the content is chosen for TTS (text-to-speech) output.
  • speak="_this" is used when you want to refer to the enclosed character content itself for TTS output
Example file :
<iml>
<box name="lab1" type="label" coords="0,0,120,60"/>
<box name="lab2" type="label" coords="0,90,80,130"/>
<box name="lab3" type="label" coords="0,140,80,180"/>
<box name="t1" type="text" coords="100,100,200,200"/>
<page>
<label box="lab1" id="one" lang="hindi" speak="_this"> Ap ka nAm k{}yA hai </label>
<text box="t1" id="txt1" lang="hindi" speak="_this">
bhArat
</text>
<text box="t1" id="text1" speak="dhis Is in i.ng{}lish">This is in English
</text>
</page>
</iml>

audiomode

  • "itrans" - (default) - the content of the speak attribute is passed on to the browser's Text-to-Speech engine as iTrans.
    a A  i I u  U RRi
    e ai o au a.n aH
    
    k kh g gh
    ch Ch j jh
    T Th D Dh N
    t th d dh n
    p ph b bh m
    y r l v sh Sh s h L
    
    For example, "Simputer" in Hindi would be formed as sim{}p{}yUTr

  • "raw" - when using audiofile attribute (see below), which passes the content of the RAW audio file to browser
  • "tts" - when the content to be spoken is directly provided as phonemes
  • "mp3" - when the content to played is a local MP3 file

audiofile

Instead of using the browser's text-to-speech engine to speak out text, you can associate an external sound file with text. When selected, the sound file will be played out instead of synthesised speech. The value of the audiofile attribute is the path to a local MP3 or RAW audio file.

audiolang

Usually, the language in which content is visually rendered is also the language in which one wants the browser to speak out. In case this is not true, audiolang allows the content to be spoken out in another language. "english"(default)|"hindi"|"kannada"|"tamil"|"telugu". The language/voice in which the contents of speak is to be synthesised in, if different from the language used to visually render the content.

hide

When a page is rendered some content may be specified to be shown and some explicitly hidden (for the time being.) Such content can then be hidden and shown n dynamically through updates.
 FAQ
  simputer
[ top ]

The Simputer Trust is a registered non-profit trust with the broad goal of harnessing the potential of Information Technology for the benefit of the weaker sections of society.

Inquiries & questions to <simputer AT csa dot iisc dot ernet> dot in.
design:corrosive

     
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.
Copyright © 2000 The Simputer Trust

This page maintained by <manohar AT csa dot iisc dot ernet dot in> with scripts and support from <vinay AT csa dot iisc dot ernet dot in>


simputer