| 90 | class XMLParser(object): |
| 91 | |
| 92 | def __init__(self, xmlpath=None, xmlstring=None): |
| 93 | self.logger = logging.getLogger(__name__) |
| 94 | self._retag = re.compile(r"(\{.*\})(.*)") |
| 95 | self.path = xmlpath |
| 96 | |
| 97 | if xmlstring: |
| 98 | self.root = ET.fromstring(xmlstring) |
| 99 | else: |
| 100 | self.root = ET.parse(xmlpath).getroot() |
| 101 | |
| 102 | # FIXME: hard to get these xml namespaces with ElementTree, we may have to shift to lxml |
| 103 | self.ns = { |
| 104 | 'base': "http://opcfoundation.org/UA/2011/03/UANodeSet.xsd", |
| 105 | 'uax': "http://opcfoundation.org/UA/2008/02/Types.xsd", |
| 106 | 'xsd': "http://www.w3.org/2001/XMLSchema", |
| 107 | 'xsi': "http://www.w3.org/2001/XMLSchema-instance" |
| 108 | } |
| 109 | |
| 110 | def get_used_namespaces(self): |
| 111 | """ |