Commit 30f65e21 authored by Philipp Hörist's avatar Philipp Hörist

Add Node.getXmlLang()

Get the xml:lang attr, if not found traverse all parents
parent b1f664db
......@@ -431,6 +431,14 @@ class Node:
except Exception:
self.addChild(tag, attrs, payload = [str(val)])
def getXmlLang(self):
lang = self.attrs.get('xml:lang')
if lang is not None:
return lang
if self.parent is not None:
return self.parent.getXmlLang()
def has_attr(self, key):
"""
Check if node have attribute "key"
......
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