SVG Tiny 1.2 - 20071117

4 Basic Data Types

4.1 Basic Data Types

The common data types for SVG's properties and attributes fall into the following categories:

<Boolean>

A <Boolean> is specified as either true or false.

<character>

A character, as per the XML production [2] Char.

<Clock-value>

The detailed description of the possible values for a <Clock-value> are detailed in Animation: Clock values.

<color>

The basic type <color> defines a color within the sRGB color space [sRGB]. <color> applies to SVG's use of the 'color' property and is a component of the definitions of properties 'fill', 'stroke', viewport-fill', 'stop-color' and 'solid-color'.

All of the syntax alternatives for <color> defined in Syntax for color values must be supported All RGB colors are specified in the sRGB color space (see [SRGB]). Using sRGB provides an unambiguous and objectively measurable definition of the color, which can be related to international standards [COLORIMETRY].

<ContentType>

An Internet Media type, as per [RFC2046].

<coordinate>

A <coordinate> represents a <length> in the user coordinate system that is the given distance from the origin of the user coordinate system along the relevant axis (the x-axis for X coordinates, the y-axis for Y coordinates).

<Focus>

The detailed description of the possible values for a <Focus> are detailed in Specifying navigation.

<FontFamilyValue>

A list of font family names and generic names. Specifically, this is the type of value that can be used for the 'font-family' property, excluding the inherit value.

<FontFamily>

A single font family name as given by a <family-name>, defined in Extensible Stylesheet Language (XSL) Version 1.1 [XSL].

<FontSizeValue>

A value that can be used for the 'font-size' property, excluding the inherit value.

<FormatList>

A list of format specifiers as detailed in The requiredFormats attribute.

<FuncXMLRI>

Functional notation for an IRI: "url(" <XMLRI> ")".

<ID>

An XML ID (see [XMLID]).

<IDREF>

The IDREF type as defined in the XML specification (either XML 1.0 [XML10] or XML 1.1 [XML11]).

<integer>

An <integer> is specified as an optional sign character ('+' or '-') followed by one or more digits "0" to "9". If the sign character is not present, the number is non-negative.

Conforming SVG Tiny 1.2 content must use <integer> values with a range of -32,768 to 32,767.

<LanguageID>

The value type accepted by xml:lang as defined in the XML specification (either XML 1.0 [XML10] or XML 1.1 [XML11]).

<length>

A length is a distance measurement. The format of a <length> is a <number> optionally followed by a unit identifier. If the <length> is expressed as a value without a unit identifier (e.g., 48), then the <length> represents a distance in the current user coordinate system.

SVG Tiny 1.2 only supports optional units on the 'width' and 'height' attributes on the 'svg' element. These can specify values in any of the following units: in, cm, mm, pt, pc, px and %. If one of the unit identifiers is provided (e.g., 12mm), then the <length> is processed according to the description in Units.

Percentage values (e.g., 10%) on the width and height attributes of the svg element represent a percent of the viewport (refer to the section that discusses Units in general).

<list-of-string>

A list-of-string consists of a separated sequence of strings. String lists are white space-separated, where white space is defined as one or more of the following consecutive characters: "space" (U+0020), "tab" (U+0009), "line feed" (U+000A) and "carriage return" (U+000D).

Here is a description of the grammar for a <list-of-string>:

List-of-string ::=
    string
     | string wsp List-of-string
 wsp ::=
     (#x20 | #x9 | #xD | #xA)
<list of xxx>

(Where xxx represents a value of some type.) A list consists of a separated sequence of values. Unless explicitly described differently, lists can be either comma-separated, with optional white space before or after the comma, or white space-separated.

White space in lists is defined as one or more of the following consecutive characters: "space" (U+0020), "tab" (U+0009), "line feed" (U+000A) and "carriage return" (U+000D).

Here is a description of the grammar for a <list of xxx>:

ListOfXXX ::=
    XXX
    | XXX comma-wsp ListOfXXX
comma-wsp ::=
    (wsp+ comma? wsp*) | (comma wsp*)
comma ::=
    ","
wsp ::=
    (#x20 | #x9 | #xD | #xA)

where XXX represents a particular type of value.

<long>

A <long> is specified as an optional sign character ('+' or '-') followed by one or more digits "0" to "9". If the sign character is not present, the number is non-negative.

A long has the range of -2,147,483,648 to 2,147,483,647.

<NCName>

The NCName production as defined in the Namespaces in XML specification (either 1.0 [XML10] or 1.1 [XML11]).

<number>

A <number> value is specified in either decimal notation or in scientific notation. A <decimal-number> consists of either an <integer>, or an optional sign character followed by zero or more digits followed by a dot (.) followed by one or more digits. A <scientific-number> consists of a <decimal-number> followed by the letter "e" or "E" followed by an <integer>.

Conforming SVG Tiny 1.2 content must use <number> s which have no more than 4 decimal digits in the fractional part of their decimal expansion and are in the range '-32,767.9999 to +32,767.9999'. It is recommended that higher precision floating point storage and computation be performed on operations such as coordinate system transformations to provide the best possible precision and to prevent round-off errors.

<paint>

The values for properties 'fill' and 'stroke' are specifications of the type of paint to use when filling or stroking a given graphics element. The available options and syntax for <paint> are described in Specifying paint.

<PathData>

Path data as detailed in the Paths chapter.

<Points>

Points data as detailed in the Basic Shapes chapter.

<string>

A sequence of characters.

<transform>

The detailed description of the possible values for a <transform> are detailed in Modifying the User Coordinate System: the transform attribute.

<XML-Name>

The Name production as defined in the XML specification (either XML 1.0 [XML10] or XML 1.1 [XML11]).

<XML-NMTOKEN>

The NMTOKEN production as defined in the XML specification (either XML 1.0 [XML10] or XML 1.1 [XML11]).

<XML-NMTOKENS>

The NMTOKENS production as defined in the XML specification (either XML 1.0 [XML10] or XML 1.1 [XML11]).

<XMLRI>

An Internationalized Resource Identifier (see IRI), using the syntactic form of an XML Resource Identifier as defined in [XLink version 1.1]. For the specification of IRI references in SVG, see IRI references.

<xslt-qname>

An xslt-qname is a QName occurring in attribute content as defined in the XSLT 1.0 Recommendation whereby if it has a prefix, then the prefix is expanded into an IRI reference using the namespace declarations in effect where the name occurs, and the default namespace is not used for unprefixed names.