What is an ExpatError?

Enunnylic

New Member
I've been playing around with parsing XML with Python, and I've found that making a spelling mistake in my xml tags raises an "ExpatError." Since I don't think my code is residing in a foreign country, to what does an ExpatError refer, in general?Misspelled Code:\[code\]minidom.parseString("<people><pesron>Dan</person><person>John</person></people>")\[/code\]Results In:\[code\]ExpatError Traceback (most recent call last)<ipython-input-5-9c00296c48cb> in <module>()----> 1 minidom.parseString("<people><pesron>Dan</person><person>John</person></people>")/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/xml/dom/minidom.pyc in parseString(string, parser) 1928 if parser is None: 1929 from xml.dom import expatbuilder-> 1930 return expatbuilder.parseString(string) 1931 else: 1932 from xml.dom import pulldom/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/xml/dom/expatbuilder.pyc in parseString(string, namespaces) 938 else: 939 builder = ExpatBuilder()--> 940 return builder.parseString(string) 941 942 /Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/xml/dom/expatbuilder.pyc in parseString(self, string) 221 parser = self.getParser() 222 try:--> 223 parser.Parse(string, True) 224 self._setup_subset(string) 225 except ParseEscape:ExpatError: mismatched tag: line 1, column 21\[/code\]
 
Back
Top