5.8 Content Element Attributes

 < Day Day Up > 



5.8 Content Element Attributes

Content markup supports about a dozen attributes. The relatively small number of attributes reflects the fact that content markup does not provide detailed information about rendering. This is in contrast to presentation markup, which requires a relatively large number of attributes (about 50), to properly describe the numerous subtle details of how notation should be visually rendered.

As discussed in Section 3.3, six attributes are accepted by all content elements:

  • class, style, and id: facilitate use of CSS and XSL stylesheets

  • xlink:href: is used for setting up links

  • xref: is used in parallel markup

  • other: is used for specifying nonstandard attributes that are not defined in MathML but may be supported by specific processing applications

The other attribute has a special role in content markup. It can be used to tell rendering applications to favor one type of notation over another when they render specific types of content markup. You can use this attribute to indicate that a particular expression should be rendered in display style instead of inline style. Alternatively, you could use it to specify that the derivative of a function should be rendered as f(x) instead of . This type of information cannot be described using existing content elements and attributes, but specific rendering applications can still recognize and interpret it.

For example, if a specific renderer recognizes a display attribute, an author could indicate that an expression be displayed in inline style using the following markup:

     <apply other='display="inline"'>       <divide/>       <mn>1</mn>       <mi>x</mi>     </apply> 

In addition to the six common attributes that are accepted by all content elements, nine other attributes are accepted by specific content elements only. A brief description of each attribute is given below.

base

This attribute is used with the cn element to specify the base of the number being encoded. It can be set to any number and has a default value of 10. For example, the following markup specifies the number 18 in binary notation:

    <cn base="2">10010</cn> 

closure

This attribute is used with the interval element to specify the type of interval being encoded. It can take the values open, closed, open-closed, or closed-open. Its default value is closed. For example, the interval [0, 1) can be specified as:

     <interval closure="open-closed">       <cn>0</cn>       <cn>1</cn>     </interval> 

definitionURL

This attribute is accepted by the csymbol, declare, and semantics elements as well as by every content element that represents an operator or function. It specifies a URL that contains semantic information about the meaning of the object being constructed.

encoding

This attribute is accepted by the semantics, annotation, annotation-xml, and csymbol elements as well as by every content element that represents an operator or function. It specifies the format used to encode semantic information about the meaning of the object being constructed.

nargs

This attribute is used with the declare element to specify the number of arguments taken by the function being declared. For example, the following expression declares a function f with two arguments:

     <declare type="fn" nargs="2">       <ci>f</ci>     </declare> 

occurrence

This attribute is used with the declare element to specify the position in which an operator being declared can occur. Possible values are prefix, infix, and function-model, with the latter being the default value.

order

This attribute is used with the list element to specify the criterion used for ordering the elements of a list. Possible values are lexicographic and numeric, which correspond to the list elements being ordered alphabetically or numerically, respectively. The default value is numeric.

scope

This attribute is used with the declare element to indicate the scope of the declaration. Possible values are local and global. In MathML 2.0, this attribute is deprecated and there is no difference between its two possible values.

type

This attribute has a slightly different meaning-allowed values and default value-depending on the type of element it is used with. It can be used with the following five content elements: cn, ci, declare, set, and tendsto.

When used with the cn element, it specifies the type of the number being encoded. Possible values are real, integer, float, rational, complex-polar, complex-cartesian, e-notation, or constant. The default value is real.

When used with the ci element, it specifies the type of identifier being encoded. In addition to all the above values that it can take when specified in the cn element, it can be set to the name of a container content element such as list, set, vector, matrix, or fn.

When used with the declare element, it declares an object to be of a specified type. It can be set to the name of any container content element such as list, set, vector, matrix, or fn.

When used with the set element, it indicates the type of set. Possible values are multiset (which indicates that repeated values are allowed) and normal (which indicates that repeated values are not allowed). The default value is normal.

When used with the tendsto element, it indicates the direction in which one quantity is approaching another. Possible values are above, below, and two-sided. The default value is above.



 < Day Day Up > 



The MathML Handbook
The MathML Handbook (Charles River Media Internet & Web Design)
ISBN: 1584502495
EAN: 2147483647
Year: 2003
Pages: 127
Authors: Pavi Sandhu

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net