Skip to content

Commit a497168

Browse files
committed
import Base findfirst and findall
1 parent 1a26f60 commit a497168

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/xmlutils/findnode.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ export findfirst, findall
33
# Find Node
44
################################################################
55
# findfirst
6-
function findfirst(name::String, doc::Document, argAmlType::Type{<:AbsNode})
6+
function Base.findfirst(name::String, doc::Document, argAmlType::Type{<:AbsNode})
77
elm = findfirst(name, root(doc), argAmlType)
88
return elm
99
end
1010

11-
function findfirst(name::String, node::Node, argAmlType::Type{<:AbsNormal})
11+
function Base.findfirst(name::String, node::Node, argAmlType::Type{<:AbsNormal})
1212
# if hasdocument(node)
1313
# elm = findfirst(name, node)
1414
# else
@@ -17,24 +17,24 @@ function findfirst(name::String, node::Node, argAmlType::Type{<:AbsNormal})
1717
return elm
1818
end
1919

20-
function findfirst(name::String, node::Node, argAmlType::Type{AbsAttribute})
20+
function Base.findfirst(name::String, node::Node, argAmlType::Type{AbsAttribute})
2121
elms = findfirstatt(name, node)
2222
return elms
2323
end
2424

25-
function findfirst(indexstr::String, node::Node, argAmlType::Type{AbsText})
25+
function Base.findfirst(indexstr::String, node::Node, argAmlType::Type{AbsText})
2626
index = parse_textindex(indexstr)
2727
elm = findfirsttext(index, node)
2828
return elm
2929
end
3030
################################################################
3131
# findall
32-
function findall(name::String, doc::Document, argAmlType::Type{<:AbsNode})
32+
function Base.findall(name::String, doc::Document, argAmlType::Type{<:AbsNode})
3333
elms = findall(name, root(doc), argAmlType)
3434
return elms
3535
end
3636

37-
function findall(name::String, node::Node, argAmlType::Type{<:AbsNormal})
37+
function Base.findall(name::String, node::Node, argAmlType::Type{<:AbsNormal})
3838
# if hasdocument(node)
3939
# elms = findall(name, node) # a vector of Node elements
4040
# else
@@ -43,12 +43,12 @@ function findall(name::String, node::Node, argAmlType::Type{<:AbsNormal})
4343
return elms
4444
end
4545

46-
function findall(name::String, node::Node, argAmlType::Type{AbsAttribute})
46+
function Base.findall(name::String, node::Node, argAmlType::Type{AbsAttribute})
4747
elms = findallatt(name, node)
4848
return elms
4949
end
5050

51-
function findall(indicesstr::String, node::Node, argAmlType::Type{AbsText})
51+
function Base.findall(indicesstr::String, node::Node, argAmlType::Type{AbsText})
5252
indices = parse_textindices(indicesstr)
5353
elms = findalltext(indices, node)
5454
return elms

0 commit comments

Comments
 (0)