Skip to content

Commit 497accb

Browse files
Andreas Monschoroulet
authored andcommitted
Fix bug where the namespace of a nodeid is migrated twice
This results in the nodeid having a wrong namespace.
1 parent 350ef18 commit 497accb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

opcua/common/xmlimporter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ def import_xml(self, xmlpath=None, xmlstring=None):
5454
self.parser = xmlparser.XMLParser(xmlpath, xmlstring)
5555

5656
self.namespaces = self._map_namespaces(self.parser.get_used_namespaces())
57-
self.aliases = self._map_aliases(self.parser.get_aliases())
57+
self._unmapped_aliases = self.parser.get_aliases()
58+
self.aliases = self._map_aliases(self._unmapped_aliases)
5859
self.refs = []
5960

6061
dnodes = self.parser.get_node_datas()
@@ -163,7 +164,7 @@ def _to_nodeid(self, nodeid):
163164
return ua.NodeId(getattr(ua.ObjectIds, nodeid))
164165
else:
165166
if nodeid in self.aliases:
166-
return self.aliases[nodeid]
167+
return self._to_nodeid(self._unmapped_aliases[nodeid])
167168
else:
168169
return ua.NodeId(getattr(ua.ObjectIds, nodeid))
169170

0 commit comments

Comments
 (0)