From cf2dc308957731df298c14fa031b3df80f47e43a Mon Sep 17 00:00:00 2001 From: Guo Yongzhi Date: Sat, 2 Nov 2024 01:49:23 +0800 Subject: [PATCH] support pushfirst!(parent::Node, child::Node) --- src/XML.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/XML.jl b/src/XML.jl index 4a3c3d9..a25a8c9 100644 --- a/src/XML.jl +++ b/src/XML.jl @@ -202,6 +202,7 @@ Base.parse(x::AbstractString, ::Type{Node}) = Node(parse(x, Raw)) Base.setindex!(o::Node, val, i::Integer) = o.children[i] = Node(val) Base.push!(a::Node, b::Node) = push!(a.children, b) +Base.pushfirst!(a::Node, b::Node) = pushfirst!(a.children, b) Base.setindex!(o::Node, val, key::AbstractString) = (o.attributes[key] = string(val)) Base.getindex(o::Node, val::AbstractString) = o.attributes[val]