Skip to content
Snippets Groups Projects

XML Converter

Merged Alexander Schlemmer requested to merge f-xml-converter into dev
All threads resolved!
3 files
+ 79
7
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -196,7 +196,7 @@ class XMLTextNode(StructureElement):
- XMLTextNodes just have a text and the name is just for identifying the structure element.
They can only be matched using the match entry in the XMLTextNodeConverter.
"""
super().__init__(element.getroottree().getelementpath(element))
super().__init__(element.getroottree().getelementpath(element) + "/text()")
self.tag = element
self.value = element.text
@@ -207,17 +207,14 @@ class XMLAttributeNode(StructureElement):
"""
def __init__(self, element: lxml.etree.Element,
key: str,
tree: lxml.etree.ElementTree):
key: str):
"""
Initializes this XML attribute node.
element: The xml tree element containing the attribute.
key: The key which identifies the attribute in the list of attributes.
tree: The tree containing the element which is used to set the node path.
"""
super().__init__(element.getroottree().getelementpath(element))
super().__init__(element.getroottree().getelementpath(element) + "@" + key)
self.value = element.attrib[key]
self.key = key
# TODO: use getpath instead of getlementpath?
self.tag = element
Loading