Skip to content

Commit

Permalink
to prevent EzXML error: JuliaIO/EzXML.jl#125
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Feb 28, 2020
1 parent 8ce7e67 commit 776296d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/xmlutils.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
using EzXML, TypeTransform
import EzXML: Document, Node

# to prevent EzXML error: https://github.com/bicycle1885/EzXML.jl/pull/125
function Base.show(io::IO, node::Node)
prefix = isdefined(Main, :Node) ? "Node" : "EzXML.Node"
ntype = EzXML.nodetype(node)
if ntype (EzXML.ELEMENT_NODE, EzXML.ATTRIBUTE_NODE) && EzXML.hasnodename(node)
desc = string(repr(ntype), '[', EzXML.nodename(node), ']')
else
desc = repr(ntype)
end
print(io, "$(prefix)(<$desc>)")
end

################################################################
import Tables
# DataTypesSupport
Expand Down

0 comments on commit 776296d

Please sign in to comment.