KUIML
Blue Cat's User Interface Programming Language
About XML

XML stands for eXtended Markup Language. It is a 'markup language', just like HTML or XHTML. The difference is that XML only definea a syntax, not tags. You can define your own tags and attributes. That's what has been done for KUIML. It respects the XML syntax and has its own tags and attributes definitions.

The other difference with HTML is that XML is more rigorous in its syntax: there are more rules. If you do not follow these rules the XML parser (the software that parses the XML file), will not accept it.

XML Syntax

Let's have a look at a very simple KUIML file:

<?xml version="1.0" encoding="utf-8" ?>
<SKIN name="small sample" language_version="1.0">
   <!-- Title -->
   <TEXT h_align="right" value="Hello!" font_height="20" font_weight="bold" font_style="italic" />
   <!-- Param 1: a column containing a knob and the name of the param-->
   <COLUMN v_align="top">
      <IMAGE_PARAM_KNOB param_id="dsp.input1" image="knob_black.bmp" image_orientation="horizontal" images_count="127">
         <!-- The tooltip is declared under the Knob so that it is displayed when the mouse is over the knob.-->
         <PARAM_TOOLTIP show_on_click="true" param_id="dsp.input1" delay_ms="0" />
      </IMAGE_PARAM_KNOB>
      <PARAM_TEXT param_id="dsp.input1" content="{name}" />
   </COLUMN>
</SKIN>

The first line <?xml version="1.0" encoding="utf-8" ?> is mandatory: it explicits the fact that the document is an XML document, and describes the encoding used. You may want to change the encoding if you use special characters. Usually you won't bother with line. Just add it to your file.

Then the document is composed of elements, starting with an opening tag (<SKIN>) and finishing with a closing tag (</SKIN>). The number of opening tags must be equal to the number of closing tags, since an element is defined by a pair of tags. You may notice that there is an exception in the above example: 'TEXT' tag is an auto-closing tag. Writing <TEXT/> is just the same as writing <TEXT></TEXT>. Use this syntax when you do not need to add elements inside another. It will simplify the document and make it easier to read.

If you enclose elements inside others (in a Blue Cat skin it means that the widgets are included inside the parent widget or layout cell), you need to close the elements before the parent is closed. For example, the following syntax is valid:

<COLUMN v_align="top">
   <PARAM_TEXT param_id="dsp.input1" content="{name}" />
   <IMAGE_PARAM_KNOB param_id="dsp.input1" image="knob.bmp" images_count="127"></IMAGE_PARAM_KNOB>
</COLUMN>

But the following is invalid:

<COLUMN v_align="top">
   <PARAM_TEXT param_id="dsp.input1" content="{name}" />
   <IMAGE_PARAM_KNOB param_id="dsp.input1" image="knob.bmp" images_count="127">
</COLUMN>
<!-- This is invalid, this element should have been closed before 'COLUMN' -->
</IMAGE_PARAM_KNOB>

Inside an element you can define attributes with their values: <PARAM_TEXT param_id="dsp.input1" content="{name}" />. The value of the attribute has to be enclosed into '', whatever the value type (string, integer, float...). If you omit these '', the file won't be valid.

You can also add comments to your XML file with the following syntax: <!– Title –>. A comment does not do anything, it's just text that may be useful for the reader of the document (including yourself!).

That's all folks! You do not need to know more about XML to write your own skins from scratch. Further more if you use an XML editor, it will do most of the work for you (see Useful Tools).

More Information

If you want more information about XML, here are some web sites to start with: