如何处理XML中的$?

时间:2013-03-21 12:20:01

标签: python xml

ElementTree会为<PRP$>抛出异常:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 3, in xml
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1301, in XML
    parser.feed(text)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1643, in feed
    self._raiseerror(v)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1507, in _raiseerror
    raise err
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 28, column 14

我从Stanford NLP包获得了这个输出。这真的是畸形吗?维基百科和其他消息来源都没提到它。

如何解决这个问题?如果我知道它是什么,我想用相应的实体替换$

0 个答案:

没有答案