Commit 24ab89fd authored by Jiahang Chen's avatar Jiahang Chen
Browse files

change xml class

parent 9fa23bd8
Pipeline #475032 passed with stages
in 50 seconds
...@@ -199,9 +199,12 @@ def find_nodes(self, path): ...@@ -199,9 +199,12 @@ def find_nodes(self, path):
new_path = "" new_path = ""
for _path in path_list: for _path in path_list:
if ":" not in _path: if ":" not in _path:
_path = "standford_ns:{}".format(_path) _path = "{" + self._namespace.get('') + "}" + _path
new_path += _path new_path += _path
new_path += "/" new_path += "/"
if new_path[-1] == "/": if new_path[-1] == "/":
new_path = new_path[:-1] new_path = new_path[:-1]
return self.root.find(new_path, self._namespace) return self.root.findall(new_path, self._namespace)
def to_string(self, root):
return self.et.tostring(root, "unicode", "xml")
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment