XML.jl icon indicating copy to clipboard operation
XML.jl copied to clipboard

get not defined to match getindex

Open oxinabox opened this issue 2 months ago • 0 comments

When something is dict-like, and defined getindex like Node does to access attributes, I expect it to also provide get to do that with a default.


julia> n = XML.Element("Foo"; x="bar")
Node Element <Foo x="bar">

julia> n["x"]
"bar"

julia> get(n, "x", "default")
ERROR: MethodError: no method matching get(::Node, ::String, ::String)
The function `get` exists, but no method is defined for this combination of argument types.

oxinabox avatar Sep 09 '25 10:09 oxinabox