.. _xml_attributes: XML Attributes ============== name ~~~~ The ``name`` attribute is used to identify the node. The names of the parents and the name of the node form the address of the node. A name has to be lower case, with no special characters and it can't begin with a number. title ~~~~~ The ``title`` of an element describes it in the GUI. All characters ( ``locale : en-US`` ) are allowed in the title. type ~~~~ The ``type`` option describes the type of data stored by the element. Possible types are: * ``integer`` * ``double`` * ``double_positive`` * ``complex`` * ``vector``: with format (for 2D vector): 1.0 -2.0 * ``fraction``: double between 0.0 and 1.0 * ``string`` or ``ascii``: one-lined text * ``liststring`` (only for info element): list of strings default ~~~~~~~ The ``default`` argument gives a value when no other value is specified by users, when launching the GUI for example. require ~~~~~~~ Some elements (such as multiple) can be based on the value of an other element. The address is made of the name of some or all the parents and the name of the element. Names are separated by blank space. The address has to be specific enough to be unique. *Example of three elements:* * avbp toto param1 * avbp titi param1 * avbp titi param2 ``param1`` is not specific enough while ``toto param1`` and ``avbp toto param1`` are unique. ``param2`` is unique and working, so is ``avbp param2`` existif ~~~~~~~ Visibility of some elements depends on the value of other elements. The argument ``existif`` allows to relate the visibility of the element on the value of others. The value of the existif has to be a boolean relationship. Values are represented by the address or a part of the address (see require) surrounded by # . Statuses are represented by the address or a part of the address (see require) surrounded by % . Strings cannot be surrounded by double quotes as it is used in the XML syntax. They have to be surrounded by braces. Basic logical operands are available: * ``&&`` for logical AND, * ``||`` for logical OR. *Examples:* * ``existif=" #toto param1# >= 2"`` The present element is visible only if the value of the element named ``param1`` (with one parent named ``toto``) is superior or equal to 2. * ``existif="#param2# == {i am a string} "`` The present element is visible only if the value of the element named ``param2`` is "i am a string" * ``existif="%model1% == 1 "`` The present element is visible only if the model named _model1_ is valid dependson ~~~~~~~~~ The argument ``dependson`` allows to connect the status of a widget to an other one. The value of the argument has to be the adresses to watch out separated by ``;`` . Parts of the addresses can be specified (see require). When one of the watched nodes is modified and if the current node's status is valid, then its status turns orange.