Xml.element.find: def of gralha-xml-doc@0.1.0.1 Import: import gralha-xml-doc@0.1.0.1/xml.bend as Xml Lines 325-331 of gralha-xml-doc@0.1.0.1/xml.bend: https://jend.leeeet.dev/read.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&start_line=325&end_line=331 import Base import gralha-text-scan@0.1.0.1/scan.bend as U def element.find(+xs: List<&2, Element>, +id: String) -> Maybe<&2, Element>: match xs: case Nil{}: None{} case Con{Element{n, as, kids, txt}, rest}: U.branch(Maybe<&2, Element>, U.string.equal(attr.get(as, "id", ""), id), _ => Some{Element{n, as, kids, txt}}, _ => element.prefer(U.branch(Maybe<&2, Element>, U.string.equal(n, "#svg-image"), _ => None{}, _ => element.find(kids, id)), element.find(rest, id))) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=branch https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=string.equal https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=Element https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attr.get https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=element.prefer