- raise ValidationError("Invalid root element. Found '%s', should be '%s'" % (
- root_elem.tag, SSTNS('section')))
+ if root_elem.tag == 'section':
+ for element in root_elem.iter():
+ if element.tag in ('section', 'header', 'div', 'span', 'aside', 'metadata'):
+ element.tag = str(SSTNS(element.tag))
+
+ parser = SSTParser()
+ tree = etree.parse(StringIO(etree.tostring(root_elem)), parser)
+ tree.xinclude()
+ self.edoc = tree
+ else:
+ raise ValueError("Invalid root element. Found '%s', should be '%s'" % (
+ root_elem.tag, SSTNS('section')))