{-# LANGUAGE OverloadedStrings #-} module Diagrams.SVG.Arguments ( -- * Attribute Parsing of classes of attributes coreAttributes , conditionalProcessingAttributes , documentEventAttributes , graphicalEventAttributes , presentationAttributes , filterPrimitiveAttributes , xlinkAttributes , xmlnsNameSpaces -- * Attributes for basic structure elements , svgAttrs , gAttrs , sAttrs , descAttrs , symbolAttrs , useAttrs , switchAttrs -- * Attributes for basic shape elements , rectAttrs , circleAttrs , ellipseAttrs , lineAttrs , polygonAttrs , pathAttrs -- * Other Attributes , clipPathAttrs , patternAttrs , imageAttrs , filterAttrs , linearGradAttrs , radialGradAttrs , setAttrs , stopAttrs , textAttrs , tspanAttrs , namedViewAttrs , perspectiveAttrs -- * Font Attributes , fontAttrs , fontFaceAttrs , glyphAttrs , missingGlyphAttrs , kernAttrs -- * Filter Effect Attributes , feBlendAttrs , feColorMatrixAttrs , feComponentTransferAttrs , feCompositeAttrs , feConvolveMatrixAttrs , feDiffuseLightingAttrs , feDisplacementMapAttrs , feFloodAttrs , feGaussianBlurAttrs , feImageAttrs , feMergeAttrs , feMorphologyAttrs , feOffsetAttrs , feSpecularLightingAttrs , feTileAttrs , feTurbulenceAttrs ) where import Text.XML.Stream.Parse import Diagrams.SVG.Attributes coreAttributes = do l <- mapM attr [ "id", "base", "lang", "space"] -- "xml:base", "xml:lang", "xml:space"] return $ (\[a,b,c,d] -> CA a b c d) l conditionalProcessingAttributes = do l <- mapM attr [ "requiredFeatures", "requiredExtensions", "systemLanguage"] return $ (\[a,b,c] -> CPA a b c) l documentEventAttributes = do l <- mapM attr [ "onunload", "onabort", "onerror", "onresize", "onscroll", "onzoom"] return $ (\[a,b,c,d,e,f] -> DEA a b c d e f) l graphicalEventAttributes = do l <- mapM attr [ "onfocusin", "onfocusout", "onactivate", "onclick", "onmousedown", "onmouseup", "onmouseover", "onmousemove", "onmouseout", "onload"] return $ (\[a,b,c,d,e,f,g,h,i,j] -> GEA a b c d e f g h i j) l presentationAttributes = do l <- mapM attr ["alignmentBaseline","baseline-shift","clip","clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cursor", "direction", "display", "dominant-baseline", "enable-background", "fill", "fill-opacity", "fill-rule", "filter", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "glyph-orientation-horizontal", "glyph-orientation-vertical", "image-rendering", "kerning", "letter-spacing", "lighting-color", "marker-end", "marker-mid", "marker-start", "mask", "opacity", "overflow", "pointer-events", "shape-rendering", "stop-color", "stop-opacity", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-anchor", "text-decoration", "text-rendering", "unicode-bidi", "visibility", "word-spacing", "writing-mode"] return $ (\[a,b,c0,c1,c2,c3,c4,c5,c6,c7,c8,d0,d1,d2,e,f0,f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12, g0,g1,i,k,l0,l1,m0,m1,m2,m3,o0,o1,p,s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,t0,t1,t2,u,v,w0,w1] -> PA a b c0 c1 c2 c3 c4 c5 c6 c7 c8 d0 d1 d2 e f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 g0 g1 i k l0 l1 m0 m1 m2 m3 o0 o1 p s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 t0 t1 t2 u v w0 w1 ) l filterPrimitiveAttributes = do l <- mapM attr [ "x","y","widh","height","result"] return $ (\[x,y,w,h,r] -> FPA x y w h r) l -- prefix :: Maybe T.Text -> T.Text -> Data.XML.Types.Name -- prefix ns attribute = Name attribute ns Nothing xlinkAttributes = -- xlinkNamespace is usually http://www.w3.org/1999/xlink do l <- mapM attr [ "{http://www.w3.org/1999/xlink}href", "{http://www.w3.org/1999/xlink}show", "{http://www.w3.org/1999/xlink}actuate", "{http://www.w3.org/1999/xlink}type", "{http://www.w3.org/1999/xlink}role", "{http://www.w3.org/1999/xlink}arcrole", "{http://www.w3.org/1999/xlink}title"] return $ (\[a,b,c,d,e,f,g] -> XLA a b c d e f g) l xmlnsNameSpaces = do l <- mapM attr [ "{http://www.w3.org/2000/svg}xlink","{http://www.w3.org/2000/svg}dc", "{http://www.w3.org/2000/svg}cc", "{http://www.w3.org/2000/svg}rdf", "{http://www.w3.org/2000/svg}svg", "{http://www.w3.org/2000/svg}sodipodi", "{http://www.w3.org/2000/svg}inkscape" ] return $ (\[xlink,dc,cc,rdf,svg,sodipodi,inkscape] -> NSP xlink dc cc rdf svg sodipodi inkscape) l xmlNameSpaces = do l <- mapM attr [ "{http://www.w3.org/XML/1998/namespace}space" ] -- the only attribute that seems to be used so far in the xml namespace is xml:space="preserve" return $ (\[space] -> space) l -------------------------------------------------------------------------------------- -- Attributes for basic structure tags, see http://www.w3.org/TR/SVG/struct.html -------------------------------------------------------------------------------------- -- | Attributes for \, see svgAttrs = do cpa <- conditionalProcessingAttributes ca <- coreAttributes gea <- graphicalEventAttributes pa <- presentationAttributes xmlns <- xmlnsNameSpaces xml <- xmlNameSpaces l <- mapM attr ["class","style","externalResourcesRequired","x","y","width","height","viewBox","preserveAspectRatio", "zoomAndPan", "version", "baseProfile", "contentScriptType", "contentStyleType"] ignoreAttrs return $ (\[class_,style,ext,x,y,w,h,view,ar,zp,ver,baseprof,cScripT,cStyleT] -> (cpa,ca,gea,pa,class_,style,ext,x,y,w,h,view,ar,zp,ver,baseprof,cScripT,cStyleT,xmlns,xml)) l -- | Attributes for \ and \, see gAttrs = do cpa <- conditionalProcessingAttributes ca <- coreAttributes gea <- graphicalEventAttributes pa <- presentationAttributes class_ <- attr "class" style <- attr "style" ext <- attr "externalResourceRequired" tr <- attr "transform" ignoreAttrs return (cpa,ca,gea,pa,class_,style,ext,tr) -- | Attributes for \ and \, see sAttrs = do ca <- coreAttributes type_ <- attr "type" media <- attr "media" title <- attr "title" ignoreAttrs return (ca,type_,media,title) -- | Attributes for \, see descAttrs = do ca <- coreAttributes class_ <- attr "class" style <- attr "style" ignoreAttrs return (ca,class_,style) -- | Attributes for \, see symbolAttrs = do ca <- coreAttributes gea <- graphicalEventAttributes pa <- presentationAttributes l <- mapM attr ["class","style","externalResourcesRequired","preserveAspectRatio","viewBox"] ignoreAttrs return $ (\[class_,style,ext,ar,viewbox] -> (ca,gea,pa,class_,style,ext,ar,viewbox) ) l -- | Attributes for \, see useAttrs = do ca <- coreAttributes cpa <- conditionalProcessingAttributes gea <- graphicalEventAttributes pa <- presentationAttributes xlink <- xlinkAttributes l <- mapM attr ["class","style","externalResourcesRequired","transform","x","y","width","height"] ignoreAttrs return $ (\[class_,style,ext,tr,x,y,w,h] -> (ca,cpa,gea,pa,xlink,class_,style,ext,tr,x,y,w,h)) l -- | Attributes for \, see switchAttrs = do cpa <- conditionalProcessingAttributes ca <- coreAttributes gea <- graphicalEventAttributes pa <- presentationAttributes class_ <- attr "class" style <- attr "style" ext <- attr "externalResourcesRequired" tr <- attr "transform" ignoreAttrs return (cpa,ca,gea,pa,class_,style,ext,tr) -------------------------------------------------------------------------------------- -- Attributes for basic shape tags -------------------------------------------------------------------------------------- -- | Attributes for \, see rectAttrs = do cpa <- conditionalProcessingAttributes ca <- coreAttributes gea <- graphicalEventAttributes pa <- presentationAttributes l <- mapM attr ["class","style","externalResourcesRequired","preserveAspectRatio","transform","x","y", "width","height","rx","ry"] ignoreAttrs return $ (\[class_,style,ext,ar,tr,x,y,w,h,rx,ry] -> (cpa,ca,gea,pa,class_,style,ext,ar,tr,x,y,w,h,rx,ry) ) l -- | Attributes for \, see circleAttrs = do cpa <- conditionalProcessingAttributes ca <- coreAttributes gea <- graphicalEventAttributes pa <- presentationAttributes l <- mapM attr ["class","style","externalResourcesRequired","transform","r","cx","cy"] ignoreAttrs return $ (\[class_,style,ext,tr,r,cx,cy] -> (cpa,ca,gea,pa,class_,style,ext,tr,r,cx,cy) ) l -- | Attributes for \, see ellipseAttrs = do cpa <- conditionalProcessingAttributes ca <- coreAttributes gea <- graphicalEventAttributes pa <- presentationAttributes l <- mapM attr ["class","style","externalResourcesRequired","transform","rx","ry","cx","cy"] ignoreAttrs return $ (\[class_,style,ext,tr,rx,ry,cx,cy] -> (cpa,ca,gea,pa,class_,style,ext,tr,rx,ry,cx,cy) ) l -- | Attributes for \, see lineAttrs = do cpa <- conditionalProcessingAttributes ca <- coreAttributes gea <- graphicalEventAttributes pa <- presentationAttributes l <- mapM attr ["class","style","externalResourcesRequired","transform","x1","y1","x2","y2"] ignoreAttrs return $ (\[class_,style,ext,tr,x1,y1,x2,y2] -> (cpa,ca,gea,pa,class_,style,ext,tr,x1,y1,x2,y2) ) l -- | Attributes for \, see polygonAttrs = do cpa <- conditionalProcessingAttributes ca <- coreAttributes gea <- graphicalEventAttributes pa <- presentationAttributes l <- mapM attr ["class","style","externalResourcesRequired","transform","points"] ignoreAttrs return $ (\[class_,style,ext,tr,points] -> (cpa,ca,gea,pa,class_,style,ext,tr,points) ) l -- | Attributes for \, see pathAttrs = do cpa <- conditionalProcessingAttributes ca <- coreAttributes gea <- graphicalEventAttributes pa <- presentationAttributes l <- mapM attr ["class","style","externalResourcesRequired","transform","d","pathLength"] ignoreAttrs return $ (\[class_,style,ext,tr,d,pathLength] -> (cpa,ca,gea,pa,class_,style,ext,tr,d,pathLength) ) l ------------------------------------------------------------------------------------- -- | Attributes for \, see clipPathAttrs = do cpa <- conditionalProcessingAttributes ca <- coreAttributes pa <- presentationAttributes l <- mapM attr ["class","style","externalResourcesRequired","transform","clipPathUnits"] ignoreAttrs return $ (\[class_,style,ext,tr,units] -> (cpa,ca,pa,class_,style,ext,tr,units) ) l -- | Attributes for \, see patternAttrs = do cpa <- conditionalProcessingAttributes ca <- coreAttributes pa <- presentationAttributes l <- mapM attr ["class","style","externalResourcesRequired","viewBox","preserveAspectRatio","x","y", "width","height","patternUnits","patternContentUnits","patternTransform"] ignoreAttrs return $ (\[class_,style,ext,view,ar,x,y,w,h,pUnits,pCUnits,pTrans] -> (cpa,ca,pa,class_,style,ext,view,ar,x,y,w,h,pUnits,pCUnits,pTrans) ) l -- | Attributes for \, see imageAttrs = do ca <- coreAttributes cpa <- conditionalProcessingAttributes gea <- graphicalEventAttributes xlink <- xlinkAttributes pa <- presentationAttributes l <- mapM attr ["class","style","externalResourcesRequired","preserveAspectRatio","transform", "x","y","width","height"] ignoreAttrs return $ (\[class_,style,ext,ar,tr,x,y,w,h] -> (ca,cpa,gea,xlink,pa,class_,style,ext,ar,tr,x,y,w,h) ) l -- | Attributes for \ fontAttrs = do ca <- coreAttributes pa <- presentationAttributes l <- mapM attr ["class","style","externalResourcesRequired","horiz-origin-x","horiz-origin-y","horiz-adv-x", "vert-origin-x","vert-origin-y","vert-adv-y"] ignoreAttrs return $ (\[class_,style,ext,horizOriginX,horizOriginY,horizAdvX,vertOriginX,vertOriginY,vertAdvY] -> (ca,pa,class_,style,ext,horizOriginX,horizOriginY,horizAdvX,vertOriginX,vertOriginY,vertAdvY) ) l -- | Attributes for \ fontFaceAttrs = do ca <- coreAttributes l <- mapM attr ["font-family","font-style","font-variant","font-weight","font-stretch","font-size","unicode-range","units-per-em","panose-1", "stemv","stemh","slope","cap-height","x-height","accent-height", "ascent", "descent", "widths", "bbox", "ideographic", "alphabetic","mathematical", "hanging", "v-ideographic", "v-alphabetic", "v-mathematical", "v-hanging", "underline-position", "underline-thickness", "strikethrough-position", "strikethrough-thickness", "overline-position", "overline-thickness"] ignoreAttrs return $ (\[fontFamily,fontStyle,fontVariant,fontWeight,fontStretch,fontSize,unicodeRange,unitsPerEm,panose1, stemv,stemh,slope,capHeight,xHeight,accentHeight,ascent,descent,widths,bbox,ideographic,alphabetic,mathematical, hanging,vIdeographic,vAlphabetic,vMathematical,vHanging,underlinePosition,underlineThickness,strikethroughPosition, strikethroughThickness,overlinePosition,overlineThickness] -> (ca,fontFamily,fontStyle,fontVariant,fontWeight,fontStretch,fontSize,unicodeRange,unitsPerEm,panose1, stemv,stemh,slope,capHeight,xHeight,accentHeight,ascent,descent,widths,bbox,ideographic,alphabetic,mathematical, hanging,vIdeographic,vAlphabetic,vMathematical,vHanging,underlinePosition,underlineThickness,strikethroughPosition, strikethroughThickness,overlinePosition,overlineThickness) ) l missingGlyphAttrs = do ca <- coreAttributes pa <- presentationAttributes l <- mapM attr ["class","style","d","horiz-adv-x","vert-origin-x","vert-origin-y","vert-adv-y"] ignoreAttrs return $ (\[class_,style,d,horizAdvX,vertOriginX,vertOriginY,vertAdvY] -> (ca,pa,class_,style,d,horizAdvX,vertOriginX,vertOriginY,vertAdvY) ) l glyphAttrs = do ca <- coreAttributes pa <- presentationAttributes l <- mapM attr ["class","style","d","horiz-adv-x","vert-origin-x","vert-origin-y","vert-adv-y","unicode","glyph-name", "orientation","arabic-form","lang"] ignoreAttrs return $ (\[class_,style,d,horizAdvX,vertOriginX,vertOriginY,vertAdvY,unicode,glyphName,orientation,arabicForm,lang] -> (ca,pa,class_,style,d,horizAdvX,vertOriginX,vertOriginY,vertAdvY,unicode,glyphName,orientation,arabicForm,lang) ) l kernAttrs = do ca <- coreAttributes l <- mapM attr ["u1","g1","u2","g2","k"] ignoreAttrs return $ (\[u1,g1,u2,g2,k] -> (ca,u1,g1,u2,g2,k) ) l -- | Attributes for \, see filterAttrs = do ca <- coreAttributes pa <- presentationAttributes xlink <- xlinkAttributes l <- mapM attr ["class","style","externalResourcesRequired","x","y","width","height","filterRes","filterUnits","primitiveUnits"] ignoreAttrs return $ (\[class_,style,ext,x,y,w,h,filterRes,filterUnits,primUnits] -> (ca,pa,xlink,class_,style,ext,x,y,w,h,filterRes,filterUnits,primUnits) ) l linearGradAttrs = do ca <- coreAttributes pa <- presentationAttributes xlink <- xlinkAttributes l <- mapM attr ["class","style","externalResourcesRequired","x1","y1","x2","y2","gradientUnits","gradientTransform","spreadMethod"] ignoreAttrs return $ (\[class_,style,ext,x1,y1,x2,y2,gradientUnits,gradientTransform,spreadMethod] -> (ca,pa,xlink,class_,style,ext,x1,y1,x2,y2,gradientUnits,gradientTransform,spreadMethod) ) l radialGradAttrs = do ca <- coreAttributes pa <- presentationAttributes xlink <- xlinkAttributes l <- mapM attr ["class","style","externalResourcesRequired","cx","cy","r","fx","fy","gradientUnits","gradientTransform","spreadMethod"] ignoreAttrs return $ (\[class_,style,ext,cx,cy,r,fx,fy,gradientUnits,gradientTransform,spreadMethod] -> (ca,pa,xlink,class_,style,ext,cx,cy,r,fx,fy,gradientUnits,gradientTransform,spreadMethod) ) l setAttrs = do ca <- coreAttributes pa <- presentationAttributes xlink <- xlinkAttributes ignoreAttrs return (ca,pa,xlink) stopAttrs = do ca <- coreAttributes pa <- presentationAttributes xlink <- xlinkAttributes class_ <- attr "class" style <- attr "style" offset <- attr "offset" ignoreAttrs return $ (ca,pa,xlink,class_,style,offset) -- | Attributes for \, see textAttrs = do cpa <- conditionalProcessingAttributes ca <- coreAttributes gea <- graphicalEventAttributes pa <- presentationAttributes l <- mapM attr ["class","style","externalResourcesRequired","transform","lengthAdjust", "x","y","dx","dy","rotate","textLength"] ignoreAttrs return $ (\[class_,style,ext,tr,la,x,y,dx,dy,rot,textlen] -> (cpa,ca,gea,pa,class_,style,ext,tr,la,x,y,dx,dy,rot,textlen) ) l tspanAttrs = do cpa <- conditionalProcessingAttributes ca <- coreAttributes gea <- graphicalEventAttributes pa <- presentationAttributes p <- mapM attr [ "class","style","externalResourcesRequired", "x", "y", "dx", "dy", "rotate", "textLength", "lengthAdjust", "{http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd}role" ] ignoreAttrs return $ ( \[class_, style, ext, x, y, dx, dy, rotate, textlen, lAdjust, role] -> (cpa,ca,gea,pa,class_,style,ext,x,y,dx,dy,rotate,textlen,lAdjust,role) ) p namedViewAttrs = do l <- mapM attr ["pagecolor","bordercolor","borderopacity","objecttolerance","gridtolerance", "guidetolerance", "id","showgrid"] inkscape <- mapM attr [ "{http://www.inkscape.org/namespaces/inkscape}pageopacity", "{http://www.inkscape.org/namespaces/inkscape}pageshadow", "{http://www.inkscape.org/namespaces/inkscape}window-width", "{http://www.inkscape.org/namespaces/inkscape}window-height", "{http://www.inkscape.org/namespaces/inkscape}zoom", "{http://www.inkscape.org/namespaces/inkscape}cx", "{http://www.inkscape.org/namespaces/inkscape}cy", "{http://www.inkscape.org/namespaces/inkscape}window-x", "{http://www.inkscape.org/namespaces/inkscape}window-y", "{http://www.inkscape.org/namespaces/inkscape}window-maximized", "{http://www.inkscape.org/namespaces/inkscape}current-layer"] ignoreAttrs return $ (\[pc,bc,bo,ot,gt,gut,id1,sg] [po,ps,ww,wh,zoom,cx,cy,wx,wy,wm,cl]-> (pc,bc,bo,ot,gt,gut,po,ps,ww,wh,id1,sg,zoom,cx,cy,wx,wy,wm,cl) ) l inkscape {- -} perspectiveAttrs = do p <- mapM attr [ "{http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd}type", "{http://www.inkscape.org/namespaces/inkscape}vp_x", "{http://www.inkscape.org/namespaces/inkscape}vp_y", "{http://www.inkscape.org/namespaces/inkscape}vp_z", "{http://www.inkscape.org/namespaces/inkscape}persp3d-origin", "id"] ignoreAttrs return $ (\[typ,vp_x,vp_y,vp_z,persp3d_origin,id_] -> (typ,vp_x,vp_y,vp_z,persp3d_origin,id_) ) p ------------------------------------------------------------------------------------------------------------- feBlendAttrs = do ca <- coreAttributes pa <- presentationAttributes fpa <- filterPrimitiveAttributes l <- mapM attr ["class","style","in","in2","mode"] ignoreAttrs return $ (\[class_,style,in1,in2,mode] -> (ca,pa,fpa,class_,style,in1,in2,mode) ) l feColorMatrixAttrs = do ca <- coreAttributes pa <- presentationAttributes fpa <- filterPrimitiveAttributes l <- mapM attr ["class","style","in","type","values"] ignoreAttrs return $ (\[class_,style,in1,type1,values] -> (ca,pa,fpa,class_,style,in1,type1,values) ) l feComponentTransferAttrs = do ca <- coreAttributes pa <- presentationAttributes fpa <- filterPrimitiveAttributes l <- mapM attr ["class","style","in"] ignoreAttrs return $ (\[class_,style,in1] -> (ca,pa,fpa,class_,style,in1) ) l feCompositeAttrs = do ca <- coreAttributes pa <- presentationAttributes fpa <- filterPrimitiveAttributes l <- mapM attr ["class","style","in","in2","operator","k1","k2","k3","k4"] ignoreAttrs return $ (\[class_,style,in1,in2,operator,k1,k2,k3,k4] -> (ca,pa,fpa,class_,style,in1,in2,operator,k1,k2,k3,k4) ) l feConvolveMatrixAttrs = do ca <- coreAttributes pa <- presentationAttributes fpa <- filterPrimitiveAttributes l <- mapM attr ["class","style","in","order","kernelMatrix","divisor","bias","targetX","targetY","edgeMode","kernelUnitLength","preserveAlpha"] ignoreAttrs return $ (\[class_,style,order,km,d,bias,tx,ty,em,ku,pa] -> (ca,pa,fpa,class_,style,order,km,d,bias,tx,ty,em,ku,pa) ) l feDiffuseLightingAttrs = do ca <- coreAttributes pa <- presentationAttributes fpa <- filterPrimitiveAttributes l <- mapM attr ["class","style","in","surfaceScale","diffuseConstant","kernelUnitLength"] ignoreAttrs return $ (\[class_,style,in1,surfaceScale,diffuseConstant,kuLength] -> (ca,pa,fpa,class_,style,in1,surfaceScale,diffuseConstant,kuLength) ) l feDisplacementMapAttrs = do ca <- coreAttributes pa <- presentationAttributes fpa <- filterPrimitiveAttributes l <- mapM attr ["class","style","in","in2","scale","xChannelSelector","yChannelSelector"] ignoreAttrs return $ (\[class_,style,in1,in2,sc,xChan,yChan] -> (ca,pa,fpa,class_,style,in1,in2,sc,xChan,yChan) ) l feFloodAttrs = do ca <- coreAttributes pa <- presentationAttributes fpa <- filterPrimitiveAttributes l <- mapM attr ["class","style"] ignoreAttrs return $ (\[class_,style] -> (ca,pa,fpa,class_,style) ) l feGaussianBlurAttrs = do ca <- coreAttributes pa <- presentationAttributes fpa <- filterPrimitiveAttributes l <- mapM attr ["class","style","in","stdDeviation"] ignoreAttrs return $ (\[class_,style,in1,stdDeviation] -> (ca,pa,fpa,class_,style,in1,stdDeviation) ) l feImageAttrs = do ca <- coreAttributes pa <- presentationAttributes fpa <- filterPrimitiveAttributes xlink <- xlinkAttributes l <- mapM attr ["class","style","externalResourcesRequired","preserveAspectRatio"] ignoreAttrs return $ (\[class_,style,ext,pa] -> (ca,pa,fpa,xlink,class_,style,ext,pa) ) l feMergeAttrs = do ca <- coreAttributes pa <- presentationAttributes fpa <- filterPrimitiveAttributes l <- mapM attr ["class","style"] ignoreAttrs return $ (\[class_,style] -> (ca,pa,fpa,class_,style) ) l feMorphologyAttrs = do ca <- coreAttributes pa <- presentationAttributes fpa <- filterPrimitiveAttributes l <- mapM attr ["class","style","in","operator","radius"] ignoreAttrs return $ (\[class_,style,in1,operator,radius] -> (ca,pa,fpa,class_,style,in1,operator,radius) ) l feOffsetAttrs = do ca <- coreAttributes pa <- presentationAttributes fpa <- filterPrimitiveAttributes l <- mapM attr ["class","style","in","dx","dy"] ignoreAttrs return $ (\[class_,style,in1,dx,dy] -> (ca,pa,fpa,class_,style,in1,dx,dy) ) l feSpecularLightingAttrs = do ca <- coreAttributes pa <- presentationAttributes fpa <- filterPrimitiveAttributes l <- mapM attr ["class","style","in","surfaceScale","specularConstant","specularExponent","kernelUnitLength"] ignoreAttrs return $ (\[class_,style,in1,surfaceScale,sc,se,ku] -> (ca,pa,fpa,class_,style,in1,surfaceScale,sc,se,ku) ) l feTileAttrs = do ca <- coreAttributes pa <- presentationAttributes fpa <- filterPrimitiveAttributes l <- mapM attr ["class","style","in"] ignoreAttrs return $ (\[class_,style,in1] -> (ca,pa,fpa,class_,style,in1) ) l feTurbulenceAttrs = do ca <- coreAttributes pa <- presentationAttributes fpa <- filterPrimitiveAttributes l <- mapM attr ["class","style","in","in2","mode"] ignoreAttrs return $ (\[class_,style,in1,in2,mode] -> (ca,pa,fpa,class_,style,in1,in2,mode) ) l