Skip to content

Commit 177d561

Browse files
committed
Fix XMLElement printing
1 parent c3a3999 commit 177d561

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/document.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,4 @@ function Base.string(xdoc::XMLDocument; encoding::String="utf-8")
116116
_xcopystr(buf_out[1])
117117
end
118118

119-
Base.show(io::IO, xdoc::XMLDocument) = println(io, Base.string(xdoc))
119+
Base.show(io::IO, xdoc::XMLDocument) = println(io, string(xdoc))

src/nodes.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,7 @@ function Base.string(nd::XMLNode)
176176
return r
177177
end
178178

179-
function Base.show(io::IO, nd::XMLNode)
180-
println(io, Base.string(nd))
181-
end
179+
Base.show(io::IO, nd::XMLNode) = println(io, string(nd))
182180

183181

184182
#######################################
@@ -206,8 +204,8 @@ has_children(x::XMLElement) = has_children(x.node)
206204
child_nodes(x::XMLElement) = child_nodes(x.node)
207205
content(x::XMLElement) = content(x.node)
208206

209-
Base.string(x::XMLElement) = Base.string(x.node)
210-
Base.show(io::IO, x::XMLElement) = Base.show(x.node)
207+
Base.string(x::XMLElement) = string(x.node)
208+
Base.show(io::IO, x::XMLElement) = show(io, x.node)
211209

212210
# attribute access
213211

0 commit comments

Comments
 (0)