I know next to nothing about xhtml. And I've got to write a python script to edit a table. But the wiki page I have to edit is for some reason not being read by any of the python xml parsers, and I haven't a clue what's going on. This is a sample page of the wiki. Can anyone tell me what the heck is wrong with this?
<h2>test</h2><p> </p><p><strong>I am a test</strong></p><p> </p><p>Now I need a table</p><table>
<tbody>
<tr>
<th>name</th>
<th>column</th>
</tr>
<tr>
<td>data1</td>
<td><p>data2</p></td>
</tr>
</tbody>
</table><p> </p><p> </p>
Here's a bit of the code I've been trying to read this with. I've gone through several iterations and different xml parsers, the pulldom, xml.dom, ElementTree, minidom, etc. They're all giving the same exception:
from xml.etree import ElementTree as ET
def main( argv ):
fileName = "/home/robbnic/Source/scripts/Gesture Service Dashboard.txt"
text = readFromFile(fileName)
try:
for event, elem in ET.iterparse(fileName):
if elem.tag == "table":
print "Hot damn!"
elem.clear()
except ET.ParseError as pe:
print pe.message
print pe.msg
print pe.args
print pe.filename
except:
print "Unexpected error:", sys.exc_info()[0]
raise
The exception error I keep getting is unbound prefix, but I know so little about xml (or xhtml in this case) that I just don't know what's going on.