4 Basic Data Types

4.1 Basic Data Types

TheThis
chapter defines a number of common data types for SVG'sused in the
definitions of SVG properties and attributes. Some data types that
are not referenced by multiple properties and attributes
fall into the following categories:are defined inline in subsequent
chapters.

<Boolean> :<boolean>

A <Boolean> isboolean value, specified as either 'true' or 'false'.'false'
.

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

A <coordinate> represents a <length>is 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). Its syntax is the same as
that for<length> .

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

<FontSizeValue><family-name>:
a

A single font sizefamily name as
detailedgiven by
a
<family-name> ,as
defined in Font selection properties
.Extensible Stylesheet Language
(XSL) Version 1.1([XSL], section 7.9.2).

<FormatList><font-size-value>: a list of format specifiers as detailed in The
requiredFormats attribute .

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

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'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'12mm' ), then the <length> is
processed according to the description in Units .

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

<list-of-content-types>

A space-separated list of Internet media
types, as used by the'requiredFormats'attribute.

The following is an EBNF grammar
describing the <list-of-content-types> syntax [EBNF]:

A <list-of-family-names> is a list
of font family names using the same syntax as the'font-family'property, excluding the <generic-family> and'inherit'values.

<list-of-string><list-of-language-ids>

A list-of-string<list-of-language-ids> is a comma separated list
of non-empty<language-id>values. White space may be used before or after the
commas.

<list-of-strings>

A <list-of-strings> consists
of a separated sequence of strings .<string>s.
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

The following is a description of thean
EBNF grammar for a
<list-of-string>:describing the
<list-of-strings> syntax [EBNF]:

(WhereTis a
value of some type):type other than<content-type> ,<string>
,<language-id>and<family-name> .) A list consists of a
separated sequence of values. Unless explicitly described
differently, listseach pair of list items can be separated either comma-separated, withby a
comma (with optional white spacewhitespace before orand after the
comma,comma) or by white
space-separated.space alone.

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(U+000D).

The following is a description of the grammartemplate for a <list of
xxx>:an EBNF grammar describing the
<list-of-Ts> syntax [EBNF]:

A real number<number> value is specified in either
decimal notation or in scientific notation
.notation. A <decimal-number><number> using decimal notation 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>Using scientific notation, it consists of a
<decimal-number>number in decimal notation followed by the letter
"e" or "E" or
"e", followed by an <integer> . Conforming

The following is an EBNF grammar
describing the <number> syntax [EBNF]:

<number> values in 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 aremust be in the range '-32,767.9999-32,767.9999 to +32,767.9999'.+32,767.9999,
inclusive. 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 .

The <points-data> type is used to
represent a <transform> are
detailedlist of points, as can be
specified in Modifying the
User Coordinate System: the transform'points'
attribute .on
a'polyline'<XML-Name>or'polygon':element. See the Name productiongrammar for points
data .

<QName>

The <QName> type is a qualified
name, as defined inby the XML specification
(either
QNameproduction in
Namespaces in XML 1.0 [
XML10]([XML-NS10], section
3), or the
QNameproduction in
Namespaces in XML 1.1 [
XML11]).([XML-NS], section 3) if
the document is an XML 1.1 document. If the <QName> 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 isnotused for unprefixed names.

A <transform> is a transformation
specification, as definedcan be specified in the XML specification (either XML 1.0 [ XML10'transform'] or XML 1.1attribute. As described inThe
'transform' attribute ,three types
of values are allowed: a transform list, a transform reference and
the'none'value.

The following is an EBNF grammar
describing the <transform> syntax [ XML11EBNF]).]: