uxpath.py: bug

This commit is contained in:
Jephté Clain 2016-08-06 11:27:50 +04:00
parent f85cd8aafb
commit 2fc7392fe1
1 changed files with 4 additions and 4 deletions

View File

@ -41,9 +41,9 @@ def dumprs(rs):
nodeType = rs.nodeType
if nodeType == Node.ELEMENT_NODE:
print rs.toxml("utf-8")
elif nodeType == ATTRIBUTE_NODE:
elif nodeType == Node.ATTRIBUTE_NODE:
print rs.value.encode("utf-8")
elif nodeType == TEXT_NODE or nodeType == CDATA_SECTION_NODE:
elif nodeType == Node.TEXT_NODE or nodeType == Node.CDATA_SECTION_NODE:
print rs.data.encode("utf-8")
else:
unsupported = True
@ -69,9 +69,9 @@ def updaters(rs, value, doc):
rs.replaceChild(textNode, firstChild)
else:
rs.insertBefore(textNode, firstChild)
elif nodeType == ATTRIBUTE_NODE:
elif nodeType == Node.ATTRIBUTE_NODE:
rs.value = value
elif nodeType == TEXT_NODE or nodeType == CDATA_SECTION_NODE:
elif nodeType == Node.TEXT_NODE or nodeType == Node.CDATA_SECTION_NODE:
rs.data = value
else:
unsupported = True