def resources
import gralha-svg-render@0.1.0.1/svg.bend as Svgimport Base
import gralha-xml-doc@0.1.0.1/xml.bend as XML
2026# Referenced elements (gradients, patterns, markers, clip paths, masks,
2027# filters) get their inherited properties on demand: the raw tree is kept
2028# under a root element whose attributes are the root svg's, and a lookup
2029# by id resolves the properties down the ancestor chain of the element it
2030# finds. Nothing is resolved for the elements a document never references.
2031def resources(xs: List<&2, XML.Element>, +root: List<&2, XML.Attr>) -> List<&2, XML.Element>:
2032 Con{XML.Element{"#root", root, xs, ""}, Nil{}}