Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
opcua-asyncio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
opcua-asyncio
Commits
365d7910
Commit
365d7910
authored
Sep 21, 2016
by
olivier R-D
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmlexporter: fix aliases and backward ref export
parent
b45c7ce5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
opcua/common/xmlexporter.py
opcua/common/xmlexporter.py
+7
-9
No files found.
opcua/common/xmlexporter.py
View file @
365d7910
...
...
@@ -40,11 +40,11 @@ class XmlExporter(object):
for
node
in
node_list
:
self
.
node_to_etree
(
node
)
# add al
l required aliases to the XML etree; must be done after nodes are added
# add al
iases to the XML etree
self
.
_add_alias_els
()
if
uris
:
# add
all namespace uris to the XML etree; must be done after aliases are added
# add
namespace uris to the XML etree
self
.
_add_namespace_uri_els
(
uris
)
def
write_xml
(
self
,
xmlpath
,
pretty
=
True
):
...
...
@@ -145,7 +145,7 @@ class XmlExporter(object):
obj_el
=
self
.
_add_node_common
(
"UAObjectType"
,
node
)
abstract
=
node
.
get_attribute
(
ua
.
AttributeIds
.
IsAbstract
).
Value
.
Value
if
abstract
:
obj_el
.
attrib
[
"IsAbstract"
]
=
str
(
abstract
)
obj_el
.
attrib
[
"IsAbstract"
]
=
'true'
self
.
_add_ref_els
(
obj_el
,
node
)
def
add_variable_common
(
self
,
node
,
el
):
...
...
@@ -234,15 +234,13 @@ class XmlExporter(object):
ref_name
=
o_ids
.
ObjectIdNames
[
ref
.
ReferenceTypeId
.
Identifier
]
else
:
ref_name
=
ref
.
ReferenceTypeId
.
to_string
()
ref_forward
=
str
(
ref
.
IsForward
).
lower
()
ref_nodeid
=
ref
.
NodeId
.
to_string
()
ref_el
=
Et
.
SubElement
(
refs_el
,
'Reference'
,
ReferenceType
=
ref_name
)
if
not
ref
_f
orward
:
ref_el
.
attrib
[
'IsForward'
]
=
ref_forward
ref_el
.
text
=
ref
_nodeid
if
not
ref
.
IsF
orward
:
ref_el
.
attrib
[
'IsForward'
]
=
'false'
ref_el
.
text
=
ref
.
NodeId
.
to_string
()
# add any references that gets used to aliases dict; this gets handled later
self
.
aliases
[
ref_name
]
=
ref
_nodeid
self
.
aliases
[
ref_name
]
=
ref
.
ReferenceTypeId
.
to_string
()
def
value_to_etree
(
el
,
dtype_name
,
dtype
,
node
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment