The This
chapter defines a number of common data types for SVG's used 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.
A <Boolean> is boolean value, specified as either 'true' or 'false'.
'false'
.
A character, as per defined by the
XML
Char production [2]
in Extensible Markup Language (XML) 1.0
([ XML10
], section 2.2), or the Char
. production
in Extensible Markup Language (XML) 1.1
([ XML11
], section 2.2) if the document is an XML 1.1
document.
An amount of the time, used by various
attributes on timed elements .The grammar describing possible values for a
<Clock-value> are detailed is
given in the Animation: Clock values . section of the
Animation
chapter.
The basic type <color>
defines a color within the sRGB color space [ [sRGB] . SRGB
]. The <color> applies to
SVG's use type is used as the
value of the 'color' property and is a component of the
definitions of properties 'fill' , 'stroke' , viewport-fill' 'stop-color' , 'stop-color' 'solid-color' and 'solid-color' 'viewport-fill' . Al
All of the syntax alternatives for
<color> defined in Syntax for color values must be
supported supported. 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 ].
An Internet Media media type, as
per [ RFC2046
]. Multipart Internet Mail
Extensions: (MIME) Part Two: Media Types
[ RFC2046
].
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> .
The detailed description type of the possible values
for a <Focus> are detailed value
that can be used in Specifying
the various navigation . attributes , such
as 'nav-next' ,
'nav-prev'
,etc. See Specifying navigation for the definition of the values that can be used in
those attributes.
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.
A single font size family name as
detailed given by
a
<family-name> ,as
defined in Font selection properties
. Extensible Stylesheet Language
(XSL) Version 1.1 ([
XSL
], section 7.9.2).
A value that can be used for the 'font-size' property, excluding the 'inherit' value.
Functional notation for an IRI:
"url(" <XMLRI> <IRI> ")".
The type of value that can be used
in an XML attribute of type ID
(see [XMLID]). (such as 'id' <IDREF> and
'xml:id' : ); that is, a string
matching the IDREF type as
defined Name production in
Extensible Markup Language (XML) 1.0
([ XML10
], section 2.3), or the Name production in
Extensible Markup Language (XML) 1.1
([ XML11
], section 2.3) if the document is an XML specification (either 1.1
document.
The type of value that can be used in
an XML attribute of type IDREF (such
as 'observer'
); that is, a string matching the
Name production in
Extensible Markup Language (XML) 1.0 [ ([
XML10 ] ], section 2.3), or
XML 1.1 [ XML11 the Name ]).
production in Extensible Markup Language (XML) 1.1
([ XML11
], section 2.3) if the document is an XML 1.1
document.
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
<integer> values in conforming
SVG Tiny 1.2 content must use <integer>
values with a be within the range
of -32,768 to 32,767. 32,767, inclusive.
An Internationalized Resource Identifier (see IRI ). For the specification of IRI references in SVG, see IRI references .
The type of
value accepted by xml:lang
the 'xml:lang' attribute as defined in the
XML specification (either XML Extensible Markup Language (XML) 1.0 [ ([
XML10 ] or
XML ], section 2.12) and Extensible Markup Language (XML) 1.1 [ ([
XML11 ]). ], section 2.12).
Specifically, this is either a language tag as defined by
BCP 47 ([
BCP
47 ], section 2) or the empty
string.
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 percent percentage of
the viewport size (refer to the section
that discusses Units in
general).
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 ]:
list-of-content-types ::= content-type | content-type wsp list-of-content-types wsp ::= (#x9 | #xD | #xA | #x20)*
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.
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.
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 the an
EBNF grammar for a
<list-of-string>: describing the
<list-of-strings> syntax [ EBNF
]:
List-of-string ::= string | string wsp List-of-string wsp ::= (#x20 | #x9 | #xD | #xA)list-of-strings ::= string | string wsp list-of-strings wsp ::= (#x9 | #xD | #xA | #x20)*
(Where T is 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, lists each pair of list items can be separated either comma-separated, with by a
comma (with optional white space
whitespace before or and 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 grammar template for a <list of
xxx>: an EBNF grammar describing the
<list-of- T
s> syntax [ EBNF
]:
ListOfXXX ::= XXX | XXX comma-wsp ListOfXXX comma-wsp ::= (wsp+ comma? wsp*) | (comma wsp*) comma ::= "," wsp ::= (#x20 | #x9 | #xD | #xA)list-of-Ts ::= T | T comma-wsp list-of-Ts comma-wsp ::= (wsp+ comma? wsp*) | (comma wsp*) comma ::= "," wsp ::= (#x9 | #xD | #xA | #x20)
Substituting a particular type other
than <content-type> ,<string>
,<language-id> and <family-name> for T
will yield a grammar for a list of
value. that
type.
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.
<long> values in conforming SVG Tiny 1.2 content must be within the range of -2,147,483,648 to 2,147,483,647, inclusive.
An XML name without colons, as defined
by the NCName
production as defined in the Namespaces
in XML specification (either 1.0
[ XML10 ] ([ XML-NS10
], section 3), or 1.1 [ XML11 the
NCName ]). production in
Namespaces in XML 1.1 ([ XML-NS ], section 3) if
the document is an XML 1.1 document.
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 ::= decimal-number | scientific-number decimal-number ::= integer | ("+" | "-")? [0-9]* "." [0-9]+ scientific-number ::= decimal-number [Ee] integer
<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 are
must 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.
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 <path-data> type is used to
represent path data data, as detailed
can be specified in the Paths chapter . <Points>
'd'
: points data as detailed in the Basic Shapes
chapter . <string> :
attribute on a sequence of characters . 'path' <transform> : The element. See the detailed description of path data ,including the possible
values grammar for path
data .
The <points-data> type is used to
represent a <transform> are
detailed list 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 production grammar for points
data .
The <QName> type is a qualified
name, as defined in by the XML specification
(either
QName production in
Namespaces in XML 1.0 [
XML10 ] ([ XML-NS10 ], section
3), or the
QName production 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 is not
used for unprefixed names.
A sequence of zero or more <Char> s.
A <transform> is a transformation
specification, as defined
can be specified in the XML specification (either XML 1.0 [ XML10 'transform'
] or XML 1.1 attribute. As described in The
'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 [ XML11 EBNF ]).
]:
transform ::= transform-list | transform-ref | "none"
An XML name, as defined in by the XML specification (either XML Name production in
Extensible Markup Language (XML) 1.0 [ ([
XML10 ] ], section 2.3), or
XML 1.1 [ XML11 the Name ]).
production in Extensible Markup Language (XML) 1.1
<XMLRI> : an Internationalized Resource
Identifier (see IRI ([ XML11
), using ],
section 2.3) if the syntactic form
of document is an XML Resource Identifier as defined in [ XLink version
1.1 ]. For the specification of
document.