转换xml文件时出错

时间:2014-01-10 11:26:42

标签: xml

我想使用blogger2wordpress应用程序将我的blogger xml文件转换为wordpress文件。现在我收到了这些错误:

Traceback (most recent call last):
  File "/base/data/home/runtimes/python/python_lib/versions/1/google/appengine/ext/webapp/_webapp25.py", line 716, in __call__
    handler.post(*groups)
  File "/base/data/home/apps/blogger2wordpress/1.342259769852558481/blogger2wordpress.py", line 37, in post
    translator = b2wp.Blogger2Wordpress(input)
  File "/base/data/home/apps/blogger2wordpress/1.342259769852558481/b2wp.py", line 69, in __init__
    self.feed = atom.FeedFromString(self.doc)
  File "/base/data/home/apps/blogger2wordpress/1.342259769852558481/atom/__init__.py", line 1338, in FeedFromString
    return CreateClassFromXMLString(Feed, xml_string)
  File "/base/data/home/apps/blogger2wordpress/1.342259769852558481/atom/__init__.py", line 93, in optional_warn_function
    return f(*args, **kwargs)
  File "/base/data/home/apps/blogger2wordpress/1.342259769852558481/atom/__init__.py", line 127, in CreateClassFromXMLString
    tree = ElementTree.fromstring(xml_string)
  File "<string>", line 85, in XML
SyntaxError: not well-formed (invalid token): line 1, column 2

有人知道如何解决它们吗?

1 个答案:

答案 0 :(得分:0)

这很可能是编码问题。确保使用与开放应用程序期望的相同的编解码器(应该是utf-8)编写XML文件。否则,您可能会遇到BOMs (Byte Order Mark)的字符串问题或问题。