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


## 
##     SVG 1.1 Basic Filter Module
##     file: svg-basic-filter.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$
##   

## 
##     Basic Filter
## 
##         filter, feBlend, feColorMatrix, feComponentTransfer, feComposite,
##         feFlood, feGaussianBlur, feImage, feMerge, feMergeNode, feOffset,
##         feTile, feFuncR, feFuncG, feFuncB, feFuncA
## 
##     This module declares markup to provide support for filter effect.
##   

## 
##     Datatypes
##   
[ xml:lang = "en" ]
grammar {
    FilterValue.datatype = xsd:string
    NumberOptionalNumber.datatype = xsd:string
    a:documentation [ "\x{a}" ~ "    SVG.Filter.attrib\x{a}" ~ "  " ]
    SVG.Filter.extra.attrib = empty
    SVG.Filter.attrib &=
        attribute filter { FilterValue.datatype }?,
        SVG.Filter.extra.attrib
    a:documentation [
        "\x{a}" ~
        "    SVG.FilterColor.attrib\x{a}" ~
        "  "
    ]
    SVG.FilterColor.extra.attrib = empty
    SVG.FilterColor.attrib &=
        attribute color-interpolation-filters {
            string "auto" | string "sRGB" | string "linearRGB" | string "inherit"
        }?,
        SVG.FilterColor.extra.attrib
    a:documentation [ "\x{a}" ~ "    SVG.Filter.class\x{a}" ~ "  " ]
    SVG.Filter.extra.class = notAllowed
    SVG.Filter.class |= filter | SVG.Filter.extra.class
    a:documentation [
        "\x{a}" ~
        "    SVG.FilterPrimitive.class\x{a}" ~
        "  "
    ]
    SVG.FilterPrimitive.extra.class = notAllowed
    SVG.FilterPrimitive.class =
        feBlend
        | feColorMatrix
        | feComponentTransfer
        | feComposite
        | feFlood
        | feGaussianBlur
        | feImage
        | feMerge
        | feOffset
        | feTile
        | SVG.FilterPrimitive.extra.class
    a:documentation [
        "\x{a}" ~
        "    SVG.FilterPrimitive.attrib\x{a}" ~
        "  "
    ]
    SVG.FilterPrimitive.extra.attrib = empty
    SVG.FilterPrimitive.attrib =
        attribute x { Coordinate.datatype }?,
        attribute y { Coordinate.datatype }?,
        attribute width { Length.datatype }?,
        attribute height { Length.datatype }?,
        attribute result { text }?,
        SVG.FilterPrimitive.extra.attrib
    a:documentation [
        "\x{a}" ~
        "    SVG.FilterPrimitiveWithIn.attrib\x{a}" ~
        "  "
    ]
    SVG.FilterPrimitiveWithIn.extra.attrib = empty
    SVG.FilterPrimitiveWithIn.attrib =
        SVG.FilterPrimitive.attrib,
        attribute in { text }?,
        SVG.FilterPrimitiveWithIn.extra.attrib
    a:documentation [
        "\x{a}" ~
        "    filter: Filter Element\x{a}" ~
        "  "
    ]
    SVG.filter.content =
        SVG.Description.class*,
        (animate | set | SVG.FilterPrimitive.class)*
    filter = element filter { attlist.filter, SVG.filter.content }
    attlist.filter &=
        SVG.Core.attrib,
        SVG.Style.attrib,
        SVG.Presentation.attrib,
        SVG.XLink.attrib,
        SVG.External.attrib,
        attribute x { Coordinate.datatype }?,
        attribute y { Coordinate.datatype }?,
        attribute width { Length.datatype }?,
        attribute height { Length.datatype }?,
        attribute filterRes { NumberOptionalNumber.datatype }?,
        attribute filterUnits {
            string "userSpaceOnUse" | string "objectBoundingBox"
        }?,
        attribute primitiveUnits {
            string "userSpaceOnUse" | string "objectBoundingBox"
        }?
    a:documentation [
        "\x{a}" ~
        "    feBlend: Filter Effect Blend Element\x{a}" ~
        "  "
    ]
    SVG.feBlend.content = (animate | set)*
    feBlend = element feBlend { attlist.feBlend, SVG.feBlend.content }
    attlist.feBlend &=
        SVG.Core.attrib,
        SVG.FilterColor.attrib,
        SVG.FilterPrimitiveWithIn.attrib,
        attribute in2 { text },
        [ a:defaultValue = "normal" ]
        attribute mode {
            string "normal"
            | string "multiply"
            | string "screen"
            | string "overlay"
            | string "darken"
            | string "lighten"
            | string "color-dodge"
            | string "color-burn"
            | string "hard-light"
            | string "soft-light"
            | string "difference"
            | string "exclusion"
            | string "hue"
            | string "saturation"
            | string "color"
            | string "luminosity"
        }?
    a:documentation [
        "\x{a}" ~
        "    feColorMatrix: Filter Effect Color Matrix Element\x{a}" ~
        "  "
    ]
    SVG.feColorMatrix.content = (animate | set)*
    feColorMatrix =
        element feColorMatrix {
            attlist.feColorMatrix, SVG.feColorMatrix.content
        }
    attlist.feColorMatrix &=
        SVG.Core.attrib,
        SVG.FilterColor.attrib,
        SVG.FilterPrimitiveWithIn.attrib,
        [ a:defaultValue = "matrix" ]
        attribute type {
            string "matrix" | string "saturate" | string "hueRotate" | string "luminanceToAlpha"
        }?,
        attribute values { text }?
    a:documentation [
        "\x{a}" ~
        "    feComponentTransfer: Filter Effect Component Transfer Element\x{a}" ~
        "  "
    ]
    SVG.feComponentTransfer.content =
        feFuncR?, feFuncG?, feFuncB?, feFuncA?
    feComponentTransfer =
        element feComponentTransfer {
            attlist.feComponentTransfer, SVG.feComponentTransfer.content
        }
    attlist.feComponentTransfer &=
        SVG.Core.attrib,
        SVG.FilterColor.attrib,
        SVG.FilterPrimitiveWithIn.attrib
    a:documentation [
        "\x{a}" ~
        "    feComposite: Filter Effect Composite Element\x{a}" ~
        "  "
    ]
    SVG.feComposite.content = (animate | set)*
    feComposite =
        element feComposite {
            attlist.feComposite, SVG.feComposite.content
        }
    attlist.feComposite &=
        SVG.Core.attrib,
        SVG.FilterColor.attrib,
        SVG.FilterPrimitiveWithIn.attrib,
        attribute in2 { text },
        [ a:defaultValue = "over" ]
        attribute operator {
            string "over" | string "in" | string "out" | string "atop" | string "xor" | string "lighter" | string "arithmetic"
        }?,
        attribute k1 { Number.datatype }?,
        attribute k2 { Number.datatype }?,
        attribute k3 { Number.datatype }?,
        attribute k4 { Number.datatype }?
    a:documentation [
        "\x{a}" ~
        "    feFlood: Filter Effect Flood Element\x{a}" ~
        "  "
    ]
    SVG.feFlood.content = (animate | set | animateColor)*
    feFlood = element feFlood { attlist.feFlood, SVG.feFlood.content }
    attlist.feFlood &=
        SVG.Core.attrib,
        SVG.Style.attrib,
        SVG.Color.attrib,
        SVG.FilterColor.attrib,
        SVG.FilterPrimitiveWithIn.attrib,
        attribute flood-color { SVGColor.datatype }?,
        attribute flood-opacity { OpacityValue.datatype }?
    a:documentation [
        "\x{a}" ~
        "    feGaussianBlur: Filter Effect Gaussian Blur Element\x{a}" ~
        "  "
    ]
    SVG.feGaussianBlur.content = (animate | set)*
    feGaussianBlur =
        element feGaussianBlur {
            attlist.feGaussianBlur, SVG.feGaussianBlur.content
        }
    attlist.feGaussianBlur &=
        SVG.Core.attrib,
        SVG.FilterColor.attrib,
        SVG.FilterPrimitiveWithIn.attrib,
        attribute stdDeviation { NumberOptionalNumber.datatype }?
    a:documentation [
        "\x{a}" ~
        "    feImage: Filter Effect Image Element\x{a}" ~
        "  "
    ]
    SVG.feImage.content = (animate | set | animateTransform)*
    feImage = element feImage { attlist.feImage, SVG.feImage.content }
    attlist.feImage &=
        SVG.Core.attrib,
        SVG.Style.attrib,
        SVG.Presentation.attrib,
        SVG.FilterPrimitive.attrib,
        SVG.XLinkEmbed.attrib,
        SVG.External.attrib,
        [ a:defaultValue = "xMidYMid meet" ]
        attribute preserveAspectRatio {
            PreserveAspectRatioSpec.datatype
        }?
    a:documentation [
        "\x{a}" ~
        "    feMerge: Filter Effect Merge Element\x{a}" ~
        "  "
    ]
    SVG.feMerge.content = feMergeNode*
    feMerge = element feMerge { attlist.feMerge, SVG.feMerge.content }
    attlist.feMerge &=
        SVG.Core.attrib,
        SVG.FilterColor.attrib,
        SVG.FilterPrimitive.attrib
    a:documentation [
        "\x{a}" ~
        "    feMergeNode: Filter Effect Merge Node Element\x{a}" ~
        "  "
    ]
    SVG.feMergeNode.content = (animate | set)*
    feMergeNode =
        element feMergeNode {
            attlist.feMergeNode, SVG.feMergeNode.content
        }
    attlist.feMergeNode &=
        SVG.Core.attrib,
        attribute in { text }?
    a:documentation [
        "\x{a}" ~
        "    feOffset: Filter Effect Offset Element\x{a}" ~
        "  "
    ]
    SVG.feOffset.content = (animate | set)*
    feOffset =
        element feOffset { attlist.feOffset, SVG.feOffset.content }
    attlist.feOffset &=
        SVG.Core.attrib,
        SVG.FilterColor.attrib,
        SVG.FilterPrimitiveWithIn.attrib,
        attribute dx { Number.datatype }?,
        attribute dy { Number.datatype }?
    a:documentation [
        "\x{a}" ~
        "    feTile: Filter Effect Tile Element\x{a}" ~
        "  "
    ]
    SVG.feTile.content = (animate | set)*
    feTile = element feTile { attlist.feTile, SVG.feTile.content }
    attlist.feTile &=
        SVG.Core.attrib,
        SVG.FilterColor.attrib,
        SVG.FilterPrimitiveWithIn.attrib
    a:documentation [
        "\x{a}" ~
        "    feFuncR: Filter Effect Function Red Element\x{a}" ~
        "  "
    ]
    SVG.feFuncR.content = (animate | set)*
    feFuncR = element feFuncR { attlist.feFuncR, SVG.feFuncR.content }
    attlist.feFuncR &=
        SVG.Core.attrib,
        attribute type {
            string "identity" | string "table" | string "discrete" | string "linear" | string "gamma"
        },
        attribute tableValues { text }?,
        attribute slope { Number.datatype }?,
        attribute intercept { Number.datatype }?,
        attribute amplitude { Number.datatype }?,
        attribute exponent { Number.datatype }?,
        attribute offset { Number.datatype }?
    a:documentation [
        "\x{a}" ~
        "    feFuncG: Filter Effect Function Green Element\x{a}" ~
        "  "
    ]
    SVG.feFuncG.content = (animate | set)*
    feFuncG = element feFuncG { attlist.feFuncG, SVG.feFuncG.content }
    attlist.feFuncG &=
        SVG.Core.attrib,
        attribute type {
            string "identity" | string "table" | string "discrete" | string "linear" | string "gamma"
        },
        attribute tableValues { text }?,
        attribute slope { Number.datatype }?,
        attribute intercept { Number.datatype }?,
        attribute amplitude { Number.datatype }?,
        attribute exponent { Number.datatype }?,
        attribute offset { Number.datatype }?
    a:documentation [
        "\x{a}" ~
        "    feFuncB: Filter Effect Function Blue Element\x{a}" ~
        "  "
    ]
    SVG.feFuncB.content = (animate | set)*
    feFuncB = element feFuncB { attlist.feFuncB, SVG.feFuncB.content }
    attlist.feFuncB &=
        SVG.Core.attrib,
        attribute type {
            string "identity" | string "table" | string "discrete" | string "linear" | string "gamma"
        },
        attribute tableValues { text }?,
        attribute slope { Number.datatype }?,
        attribute intercept { Number.datatype }?,
        attribute amplitude { Number.datatype }?,
        attribute exponent { Number.datatype }?,
        attribute offset { Number.datatype }?
    a:documentation [
        "\x{a}" ~
        "    feFuncA: Filter Effect Function Alpha Element\x{a}" ~
        "  "
    ]
    SVG.feFuncA.content = (animate | set)*
    feFuncA = element feFuncA { attlist.feFuncA, SVG.feFuncA.content }
    attlist.feFuncA &=
        SVG.Core.attrib,
        attribute type {
            string "identity" | string "table" | string "discrete" | string "linear" | string "gamma"
        },
        attribute tableValues { text }?,
        attribute slope { Number.datatype }?,
        attribute intercept { Number.datatype }?,
        attribute amplitude { Number.datatype }?,
        attribute exponent { Number.datatype }?,
        attribute offset { Number.datatype }?
}
