<xmlnode id=2 text='"Hello World!"' />
How do i read the “Hello World” without unescaping in python. I’m using ElementTree like this
xmlstr = """\
<?xml version="1.0" encoding="utf-8"?>
<nodes>
<xmlnode id=1 text='"Hello World!"' />
<xmlnode id=2 text='"Hello World!"' />
</nodes>
"""
elem = ElementTree.fromstring(xmlstr)
nodes = elem.findall('xmlnode')
for row in nodes:
print str(row.get('id'))+ ": " + row.get('text')
output
1: "Hello World"
2: "Hello World"
I want
1: "Hello World"
2: "Hello World"
Try this, using prepared statements:
As indicated, I don’t think storing the escaped value in the database will do you any good. Use the actual values in the DB, it will make your life very much easier down the road.