xml_tools: minor attribute renaming
This commit is contained in:
parent
32592acdf5
commit
7cbcc26d7d
1 changed files with 5 additions and 5 deletions
|
|
@ -1105,10 +1105,10 @@ class ElementParser(object):
|
||||||
Found at http://stackoverflow.com/questions/2093400/how-to-create-twisted-words-xish-domish-element-entirely-from-raw-xml/2095942#2095942
|
Found at http://stackoverflow.com/questions/2093400/how-to-create-twisted-words-xish-domish-element-entirely-from-raw-xml/2095942#2095942
|
||||||
(c) Karl Anderson"""
|
(c) Karl Anderson"""
|
||||||
|
|
||||||
def __call__(self, string, force_spaces=False):
|
def __call__(self, raw_xml, force_spaces=False):
|
||||||
"""
|
"""
|
||||||
@param string: the XML string
|
@param raw_xml(unicode): the raw XML
|
||||||
@param force_spaces: if True, replace occurrences of 'n' and '\t' with ' '.
|
@param force_spaces: if True, replace occurrences of '\n' and '\t' with ' '.
|
||||||
"""
|
"""
|
||||||
self.result = None
|
self.result = None
|
||||||
|
|
||||||
|
|
@ -1127,7 +1127,7 @@ class ElementParser(object):
|
||||||
parser.DocumentEndEvent = onEnd
|
parser.DocumentEndEvent = onEnd
|
||||||
tmp = domish.Element((None, "s"))
|
tmp = domish.Element((None, "s"))
|
||||||
if force_spaces:
|
if force_spaces:
|
||||||
string = string.replace('\n', ' ').replace('\t', ' ')
|
raw_xml = raw_xml.replace('\n', ' ').replace('\t', ' ')
|
||||||
tmp.addRawXml(string)
|
tmp.addRawXml(raw_xml)
|
||||||
parser.parse(tmp.toXml().encode('utf-8'))
|
parser.parse(tmp.toXml().encode('utf-8'))
|
||||||
return self.result.firstChildElement()
|
return self.result.firstChildElement()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue