6.8 Element Attributes

The attributes below are all predefined in stdattrs.mxl. If an <element> definition also defines any, the definition in the <element> overrides the standard one.

All elements have an implied attribute set in:

  <defref src="stdattrs.mxl" idref="CommonAttrs" />

Attributes, like elements, have properties. For the predefined attributes, the property is the same as the attribute name. For added attributes, the property can be specified in the <attr> element @props. As with <elements>, if an <attr> property is redefined in an <element> definition, the redefinition prevails.

These CommonAttrs are available for any <element>:

  name      a name for the item, typically in definitions
  id        an id by which the item can be referenced, unique in its file
  type      a general-purpose type attribute, often specialized for an element
  sort      a sort string for elements such as <glossdef> that may need it
  importance from DITA, used for elements such as <note> as needed
  class     a category often mapped to a presentational format by processors
  lang      the standard language identifier, like en-US

  cond      a general-purpose condition specifier, space-delimited list
  audience  the document or element audience
  product   the product to which the element applies
  version   the version of the product or document

  src       the source for a reference, normally a URL, like HTML @href
  idref     a specific element id within the source
  idrefs    specific element ids within the source; two are a range, more are a list
  key       a key defined in a <key> element to address the source
  project   the root <map> of another project from which to get the src
  output    the specific output to reference, if not always the current one
  branch    the name of the <branch> for the source, if not the current one

These are for <cond> elements to define conditions to use:

  attr      the attribute to check, such as @audience
  include   a boolean expression of values, true to include
  exclude   a boolean expression of values, true to exclude
  flag      a boolean expression of values, true to flag

These are for <table>:

  order     cell order, either by rows or by columns, default row
  rows      the number of rows (optional)
  cols      the number of columns (optional)
  width     total width of the table (optional)

These are for table <col>s:

  pos       position, may be list with ranges
  type      body or head, default body
  width     the column width in CSS units

These are for table <row>s:

  pos       position, may be list with ranges
  type      body, head, or foot, default body
  height    the row height in CSS units

These are for table <cell>s:

  colspan   the number of columns the cell spans, default 1
  rowspan   the number of rows the cell spans, default 1
  align     left center right, default left in body, center in head and foot
  valign    top middle bottom, default top in body, middle in head and foot

These are for <image> and <img>:

  width     the item width in CSS units
  height    the item height in CSS units
  depth     the item depth in CSS units
  top       distance to move down (minus for up) in CSS units
  left      distance to move right (minus for left) in CSS units
  alt       text to use if image cannot be displayed

These are for <fig>, <imagemap>, and <object>:

  width     the item width in CSS units
  height    the item height in CSS units

These are for <area> (used in <imagemap>):

  shape     the area shape, default rect: rect, circle, or poly
  coords    a list of x,y coordinates, comma delimited, as in x1,y1,x2,y2,...

These are for <idx>:

  start     the new id for the range starting here
  end       the idref of the range ending here
  see       the idref for the entry to put as the see reference
  seealso   the idref for the entry to put as the see also reference

This is for <code>:

  language  the programming language or format name, such as CSS or RTF

This is for <ul> lists:

  styletype the CSS value, default disc:  disc, circle, square, none

This is for <ol> lists:

  styletype the CSS value, default decimal:  decimal, upper-alpha,
            lower-alpha, upper-roman, lower-roman

This is for <docref> and <doclist>:

  start     what the doc should start, default none: none page file

These are for <relref>:

  subjects  names of the subjects to which the doc applies
  weight    importance of the subjects in the doc, default 1

These are for <dirref>, <dbref>, and <webref>:

  query     a query to use for a directory, database, or Web reference
  results   element path to use for query results, default p/li/sl

This is for <element>:

  props     list of element properties, space-delimited
  short     for elements with a short-tag equivalent, the short name
  full      for short elements with a full-tag equivalent, the full name
  wiki      for elements with a wiki equivalent, the wiki symbol

This is for <wiki>:

  props     list of wiki element properties, space-delimited
  symbol    the wiki symbol used
  tag       the tag represented by the wiki symbol
  space     yes if must be preceded or followed by space or a symbol
  code      no if literal in code, set if it sets code itself
  sch       starting character to add if any
  ech       ending character to add if any

This is for <attr>:

  default   default for attribute type property

This is for <key>:

  keys      list of keys defined here, space-delimited

This is for <listdef>:

  sort      how to sort a generated list, default doc: doc alpha numeric

These are for <listdef> <item>s:

  level     level in the list, decimal number, default 1
  elpath    element and context to include in list, default none
  itemclass classes of the element to include, default any

This is for <tset> (HTML <pre> tab definitions):

  tN        tab number, 1 to 20, as in t1, t2, etc.

This is for <udx>:

  switch    switch to modify udx proessing for enclosed elements

In addition, any others may be added for specific elements or groups of elements in the <element> definition element. Processors silently ignore undefined attributes; editors may warn, but should not prohibit them. The predefined attribute types are:

  name    name per the rules for MicroXML element and attribute names, default ""
  text    text content, can include spaces
  bool    yes or no, 1 or 0, or equivalent in another language
  elem    name of a uDoc element
  elist   names such as ids of uDoc elems, one or more, space- or comma-delimited
  epath   series of element parent names, bottom up, slash delimited, with wildcards
  file    with or without path; may be platform-dependent
  url     standard url syntax
  enum    defined by a space-delimited list, first item is default
  size    number with CSS units, default "0"
  num     plain integer, no units, default "1"
  nlist   number list, digits separated by spaces or commas, as in <coords>
  unit    unit for tab positions, col or CSS size unit, default "col"
  tval    tab definition, L (default), C, R, or an align char, then a char pos, then a leader
  expr    expression in C syntax, " and ", " or ", and " not " allowed for "&&", "||", and "!"
  regex   regular expression for string matching
  lang    standard language identifier, default "en-US"

Users are free to use their own attribute types, but processors and editors are not required to recognize them.

Previous Topic:  6.7 Element Properties

Next Topic:  Appendix A. Comparison of Markup Formats

Parent Topic:  Chapter 6. uDoc Elements

Sibling Topics:

6.1 Creating New Elements

6.2 Events and Ranges

6.3 Range Generation

6.4 Creating New Shorthand Symbols

6.5 Foreign Elements

6.6 Content Models

6.7 Element Properties