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
23d19f6f
Commit
23d19f6f
authored
Sep 20, 2016
by
olivier R-D
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmlexporter: description is a child element not attribute
parent
8f029f0e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
opcua/common/xmlexporter.py
opcua/common/xmlexporter.py
+9
-6
No files found.
opcua/common/xmlexporter.py
View file @
23d19f6f
...
...
@@ -106,11 +106,16 @@ class XmlExporter(object):
else
:
self
.
logger
.
info
(
"Exporting node class not implemented: %s "
,
node_class
)
def
_add_sub_el
(
self
,
el
,
name
,
text
):
child_el
=
Et
.
SubElement
(
el
,
name
)
child_el
.
text
=
text
return
child_el
def
_add_node_common
(
self
,
nodetype
,
node
):
browsename
=
node
.
get_browse_name
().
to_string
()
nodeid
=
node
.
nodeid
.
to_string
()
parent
=
node
.
get_parent
()
displayname
=
node
.
get_display_name
().
Text
.
decode
(
encoding
=
'UTF
8'
)
displayname
=
node
.
get_display_name
().
Text
.
decode
(
'utf-
8'
)
desc
=
node
.
get_description
().
Text
print
(
"NODE COMMON"
,
node
)
node_el
=
Et
.
SubElement
(
self
.
etree
.
getroot
(),
...
...
@@ -120,9 +125,8 @@ class XmlExporter(object):
if
parent
is
not
None
:
node_el
.
attrib
[
"ParentNodeId"
]
=
parent
.
nodeid
.
to_string
()
if
desc
not
in
(
None
,
""
):
node_el
.
attrib
[
"Description"
]
=
str
(
desc
)
disp_el
=
Et
.
SubElement
(
node_el
,
'DisplayName'
,
)
disp_el
.
text
=
displayname
self
.
_add_sub_el
(
node_el
,
'Description'
,
desc
.
decode
(
'utf-8'
))
self
.
_add_sub_el
(
node_el
,
'DisplayName'
,
displayname
)
return
node_el
def
add_etree_object
(
self
,
obj
):
...
...
@@ -204,8 +208,7 @@ class XmlExporter(object):
nuris_el
=
Et
.
Element
(
'NamespaceUris'
)
for
uri
in
uris
:
uri_el
=
Et
.
SubElement
(
nuris_el
,
'Uri'
)
uri_el
.
text
=
uri
self
.
_add_sub_el
(
nuris_el
,
'Uri'
,
uri
)
self
.
etree
.
getroot
().
insert
(
0
,
nuris_el
)
...
...
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