[DAS2] new stylesheet syntax

Andrew Dalke dalke at dalkescientific.com
Mon May 1 06:14:10 UTC 2006


I've been thinking about the stylesheet document format.  I've
changed it somewhat.  Here's what the latest version looks like

<STYLESHEET>
   <STYLE 
uri="http://biodas.org/das2/bos_taurus/Dec2006/type/five_prime_UTR"
          zoom="high">
     <BOX fgcolor="red" />
     <LABEL fgcolor="black" />
   </STYLE>

   <STYLE 
uri="http://biodas.org/das2/bos_taurus/Dec2006/type/five_prime_UTR"
          zoom="medium">
     <BOX fgcolor="red" />
   </STYLE>

   <STYLE 
uri="http://biodas.org/das2/bos_taurus/Dec2006/type/five_prime_UTR"
          zoom="low">
     <LINE fgcolor="red" />
   </STYLE>

   <STYLE 
uri="http://biodas.org/das2/bos_taurus/Dec2006/type/strong_gene">
     <BOX fgcolor="black" border_style="solid" />
   </STYLE>

   <STYLE 
uri="http://biodas.org/das2/bos_taurus/Dec2006/type/moderate_gene">
     <BOX fgcolor="black" border_style="dotted" />
   </STYLE>

   <STYLE uri="http://biodas.org/das2/bos_taurus/Dec2006/type/weak_gene">
     <BOX fgcolor="gray" border_style="dotted" />
   </STYLE>

</STYLESHEET>

The change is that the attributes in the <STYLE> element are only
used as selectors, that is, fields which select feature types.  I've
moved the 'width', 'height', and 'bump' elements to a <SET> element.

The core of the schema looks like this.

style = element STYLE {
   # These are selectors.
   attribute uri { text },
   attribute zoom { "high" | "medium" | "low" }?,

   set_element,

   # Must specify a glyph, may specify a label.  Can be in
   # either order.
   ((glyph, label?) | (label, glyph))

}

# Set default depiction properties
set_element = element SET {
   height?,
   width?,
   bump { "yes" | "no" }?
}

If you hadn't looked at the previous schema, the height, width,
and bump attributes were in the STYLE attributes along with 'fgcolor'
and 'bgcolor', which provided defaults for the glyphs and title, but
the latter two could override the defaults.

The main reason for the change is to separate selectors from
the actual style.  I got rid of the default fg/bg colors because

					Andrew
					dalke at dalkescientific.com




More information about the DAS2 mailing list