The CSS definition file is the core of cssed. It is installed in the prefix/share/cssed/data folder and named cssed-def.xml, together with the default configuration file named cssed-cfg.xml, and the dtd file named cssed-def.dtd. It has all valid CSS properties and values.
All properties and values in cssed will be taken from this file. It is used by the tree view (View: the Section called The tree view in Chapter 3), and by auto completion (View: the Section called Auto completion in Chapter 3).
Its format is really easy XML. It has three tags only:
<cssed-def></cssed-def> - It is the root node and can contain one or more <element> tags.
<element> </element> - It defines a CSS property as “border” or “margin” it can contain one or more <value> tags.
<value /> - It defines one of the possible values for the element and it is an empty tag (it cannot contain any other tags).
The cssed-def element has a property implementation that will be shown as the root node in the tree view (View: the Section called The tree view in Chapter 3). Valid examples are:
<csssed-def implementation="CSS-2"></cssed-def> <csssed-def implementation="My CSS"></cssed-def> |
The element node has an attribute name that must contain the property's name. Valid examples are:
<element name="azimuth"></element><element name="azimuth"></element> |
The value node has two attributes. The first named type is right now unused but it is mandatory to set it to the values string or fixed-string for compatibility with further versions of cssed. The second one, name, must contain the value itself. If type is equal to string, it means that is a complex - not fixed - value and must be dialog driven. The dialog name must be enclosed between braces. If type is equal to fixed-string, it means that the string in the name attribute is a possible value for the property and will be inserted directly. Valid examples are:
<value type="string" name="(angle)" /> <value type="fixed-string" name="none" /> <value type="fixed-string" name="red" /> |
In the first example a dialog named “(angle)” will be used to drive property's value insertion. In the second and third ones, the values none and red will be directly inserted as valid property's value.
A complete example of cssed configuration file can be:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <csssed-def implementation="CSS-2"> <element name="azimuth"> <value type="string" name="(angle)" /> <value type="fixed-string" name="none" /> </element> </cssed-def> |