comparison src/tools/xml_tools.py @ 1791:1359ad0b37c2

reverted patch 3770d13776e8
author Goffi <goffi@goffi.org>
date Wed, 13 Jan 2016 13:11:20 +0100
parents d17772b0fe22
children 17c0364607be
comparison
equal deleted inserted replaced
1790:bf7e468fe440 1791:1359ad0b37c2
1353 tmp.addRawXml(raw_xml) 1353 tmp.addRawXml(raw_xml)
1354 parser.parse(tmp.toXml().encode('utf-8')) 1354 parser.parse(tmp.toXml().encode('utf-8'))
1355 return self.result.firstChildElement() 1355 return self.result.firstChildElement()
1356 1356
1357 1357
1358 def decapsulateDomishContent(elt):
1359 """Return the inner content of a domish.Element.
1360
1361 @param elt (domish.Element)
1362 @return unicode
1363 """
1364 result = ''
1365 for child in elt.children:
1366 try:
1367 result += child.toXml() # child id a domish.Element
1368 except AttributeError:
1369 result += child # child is unicode
1370 return result
1371
1372
1373 # FIXME: this method is duplicated from frontends.tools.xmlui.getText 1358 # FIXME: this method is duplicated from frontends.tools.xmlui.getText
1374 def getText(node): 1359 def getText(node):
1375 """Get child text nodes of a domish.Element. 1360 """Get child text nodes of a domish.Element.
1376 1361
1377 @param node (domish.Element) 1362 @param node (domish.Element)