default namespace = "http://www.w3.org/2000/svg"
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"


## 
##     SVG 1.1 Animation Module
##     file: svg-animation.rng
## 
##     This is SVG, a language for describing two-dimensional graphics in XML.
##     Copyright 2001, 2002 W3C (MIT, INRIA, Keio), All Rights Reserved.
##
##     Modifications Copyright 2007 Mozilla Foundation
## 
##     $Id$
##   

## 
##     Animation
## 
##         animate, set, animateMotion, animateColor, animateTransform, mpath
## 
##     This module declares markup to provide support for animation.
##   

## 
##     SVG.Animation.class
##   
[ xml:lang = "en" ]
grammar {
    SVG.Animation.extra.class = notAllowed
    SVG.Animation.class |=
        animate
        | set
        | animateMotion
        | animateColor
        | animateTransform
        | SVG.Animation.extra.class
    a:documentation [ "\x{a}" ~ "    SVG.Animation.attrib\x{a}" ~ "  " ]
    SVG.Animation.extra.attrib = empty
    SVG.Animation.attrib = SVG.XLink.attrib, SVG.Animation.extra.attrib
    a:documentation [
        "\x{a}" ~
        "    SVG.AnimationAttribute.attrib\x{a}" ~
        "  "
    ]
    SVG.AnimationAttribute.extra.attrib = empty
    SVG.AnimationAttribute.attrib =
        attribute attributeName { text },
        attribute attributeType { text }?,
        SVG.AnimationAttribute.extra.attrib
    a:documentation [
        "\x{a}" ~
        "    SVG.AnimationTiming.attrib\x{a}" ~
        "  "
    ]
    SVG.AnimationTiming.extra.attrib = empty
    SVG.AnimationTiming.attrib =
        attribute begin { text }?,
        attribute dur { text }?,
        attribute end { text }?,
        attribute min { text }?,
        attribute max { text }?,
        [ a:defaultValue = "always" ]
        attribute restart { string "always" | string "never" | string "whenNotActive" }?,
        attribute repeatCount { text }?,
        attribute repeatDur { text }?,
        [ a:defaultValue = "remove" ]
        attribute fill { string "remove" | string "freeze" }?,
        SVG.AnimationTiming.extra.attrib
    a:documentation [
        "\x{a}" ~
        "    SVG.AnimationValue.attrib\x{a}" ~
        "  "
    ]
    SVG.AnimationValue.extra.attrib = empty
    SVG.AnimationValue.attrib =
        [ a:defaultValue = "linear" ]
        attribute calcMode {
            string "discrete" | string "linear" | string "paced" | string "spline"
        }?,
        attribute values { text }?,
        attribute keyTimes { text }?,
        attribute keySplines { text }?,
        attribute from { text }?,
        attribute to { text }?,
        attribute by { text }?,
        SVG.AnimationValue.extra.attrib
    a:documentation [
        "\x{a}" ~
        "    SVG.AnimationAddtion.attrib\x{a}" ~
        "  "
    ]
    SVG.AnimationAddtion.extra.attrib = empty
    SVG.AnimationAddtion.attrib =
        [ a:defaultValue = "replace" ]
        attribute additive { string "replace" | string "sum" }?,
        [ a:defaultValue = "none" ]
        attribute accumulate { string "none" | string "sum" }?,
        SVG.AnimationAddtion.extra.attrib
    a:documentation [
        "\x{a}" ~
        "    animate: Animate Element\x{a}" ~
        "  "
    ]
    SVG.animate.content = SVG.Description.class*
    animate = element animate { attlist.animate, SVG.animate.content }
    attlist.animate &=
        SVG.Core.attrib,
        SVG.Conditional.attrib,
        SVG.AnimationEvents.attrib,
        SVG.External.attrib,
        SVG.Animation.attrib,
        SVG.AnimationAttribute.attrib,
        SVG.AnimationTiming.attrib,
        SVG.AnimationValue.attrib,
        SVG.AnimationAddtion.attrib
    a:documentation [ "\x{a}" ~ "    set: Set Element\x{a}" ~ "  " ]
    SVG.set.content = SVG.Description.class*
    set = element set { attlist.set, SVG.set.content }
    attlist.set &=
        SVG.Core.attrib,
        SVG.Conditional.attrib,
        SVG.AnimationEvents.attrib,
        SVG.External.attrib,
        SVG.Animation.attrib,
        SVG.AnimationAttribute.attrib,
        SVG.AnimationTiming.attrib,
        attribute to { text }?
    a:documentation [
        "\x{a}" ~
        "    animateMotion: Animate Motion Element\x{a}" ~
        "  "
    ]
    SVG.animateMotion.content = SVG.Description.class*, mpath?
    animateMotion =
        element animateMotion {
            attlist.animateMotion, SVG.animateMotion.content
        }
    attlist.animateMotion &=
        SVG.Core.attrib,
        SVG.Conditional.attrib,
        SVG.AnimationEvents.attrib,
        SVG.External.attrib,
        SVG.Animation.attrib,
        SVG.AnimationTiming.attrib,
        SVG.AnimationAddtion.attrib,
        [ a:defaultValue = "paced" ]
        attribute calcMode {
            string "discrete" | string "linear" | string "paced" | string "spline"
        }?,
        attribute values { text }?,
        attribute keyTimes { text }?,
        attribute keySplines { text }?,
        attribute from { text }?,
        attribute to { text }?,
        attribute by { text }?,
        attribute path { text }?,
        attribute keyPoints { text }?,
        attribute rotate { text }?,
        attribute origin { text }?
    a:documentation [
        "\x{a}" ~
        "    animateColor: Animate Color Element\x{a}" ~
        "  "
    ]
    SVG.animateColor.content = SVG.Description.class*
    animateColor =
        element animateColor {
            attlist.animateColor, SVG.animateColor.content
        }
    attlist.animateColor &=
        SVG.Core.attrib,
        SVG.Conditional.attrib,
        SVG.AnimationEvents.attrib,
        SVG.External.attrib,
        SVG.Animation.attrib,
        SVG.AnimationAttribute.attrib,
        SVG.AnimationTiming.attrib,
        SVG.AnimationValue.attrib,
        SVG.AnimationAddtion.attrib
    a:documentation [
        "\x{a}" ~
        "    animateTransform: Animate Transform Element\x{a}" ~
        "  "
    ]
    SVG.animateTransform.content = SVG.Description.class*
    animateTransform =
        element animateTransform {
            attlist.animateTransform, SVG.animateTransform.content
        }
    attlist.animateTransform &=
        SVG.Core.attrib,
        SVG.Conditional.attrib,
        SVG.AnimationEvents.attrib,
        SVG.External.attrib,
        SVG.Animation.attrib,
        SVG.AnimationAttribute.attrib,
        SVG.AnimationTiming.attrib,
        SVG.AnimationValue.attrib,
        SVG.AnimationAddtion.attrib,
        [ a:defaultValue = "translate" ]
        attribute type {
            string "translate" | string "scale" | string "rotate" | string "skewX" | string "skewY"
        }?
    a:documentation [
        "\x{a}" ~
        "    mpath: Motion Path Element\x{a}" ~
        "  "
    ]
    SVG.mpath.content = SVG.Description.class*
    mpath = element mpath { attlist.mpath, SVG.mpath.content }
    attlist.mpath &=
        SVG.Core.attrib, SVG.XLinkRequired.attrib, SVG.External.attrib
}
