A draft for a standard for desktop configuration

Philip Van Hoof spam at pvanhoof.be
Sun Sep 25 15:28:17 EEST 2005


This is another sample

The crème de la crème: a list of non-homogeneous types with two default
items and a maximum and minimum restriction on one of the entities.

This schema would define the key with path "/a/b/c/list_of_fonts". It
defines it as a list of fonts {string, integer} with the defaults
{"Arial", 8} and {"Times new roman", 12}. The minimum size of the font
is 6 and the maximum size of the font is 32.

The root namespace here is "a", the application name is "b" and the
preferences domain in which the preference belongs is "c" (but this last
component is optional and to be freely used by the app developer. So
it's basically unspecified). The string "list_of_fonts" is the name of
the preference. You can also say that "c/list_of_fonts" is the name of
the preference, but the specification doesn't do this.

The reason it doesn't do this is because it explicitly forbids the
character '/' in path components. 

The spec makes "c" a non-leaf component of the path and so must be
defined in a node element. Because that makes "list_of_fonts" the leaf,
it's called the name of the preference or short "prefname".


I might have made a mistake by declaring "format" #REQUIRED. In this
example, the list "is" homogeneous yet I had to declare it
"non-homogeneous" because there's no other option. I might add
"homogeneous" to the enumeration and/or replace the #REQUIRED of the
attribute with #IMPLIED (so that in this case you can omit it).

I'm open to suggestions about this problem (I noticed it while creating
the sample).

Note that I haven't added a description to this sample simply because
that part is unfinished (and probably the most tricky part of the
schema).

<schemas>
 <node name="a"><node name="b"><node name="c">
  <schema prefname="list_of_fonts">

    <!-- The format attribute has a problem here -->
    <type real="list" format="non-homogeneous">

     <list>
       <type alias="font" real="list" format="non-homogeneous">
        <list>
          <type alias="name" real="simple" format="string"/>
          <type alias="size" real="simple" format="integer">
                <min>6</min><max>32</max>
          </type>
        </list>
       </type>
      </list>

     </type>

     <default>
       <default alias="font">
          <default alias="name">Arial</default>
          <default alias="size">8</default>
       </default>
       <default alias="font">
          <default alias="name">Times new roman</default>
          <default alias="size">12</default>
       </default>
     </default>
  </schema>

 </node></node></node>
</schemas>


-- 
Philip Van Hoof, software developer at x-tend
home: me at pvanhoof dot be
gnome: pvanhoof at gnome dot org
work: vanhoof at x-tend dot be
http://www.pvanhoof.be - http://www.x-tend.be




More information about the xdg mailing list