创建 XULRunner 应用程序时遇到 XML 解析错误
我尝试创建教程中给出的 XULRunner 应用程序 - http://pyxpcomext.mozdev .org/no_wrap/tutorials/pyxulrunner/python_xulrunner_about.html
但是当我尝试运行该应用程序时,它给出了我出现以下错误 -
XML Parsing Error:
Location: chrome://pyxpcom_gui_app/content/pyxpcom_gui_app.xul
Line Number 19, Column 48:
persist="screenX screenY width height">
-----------------------------------------------^
我没有明白出了什么问题。 pyxpcom_gui_app.xul 的内容 -
<window id="pyxpcom_gui_app"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&pyxpcom_gui_app.title;"
style="width: 700px; height: 500px;"
script-type="application/x-python"
persist="screenX screenY width height"> <!-- This is Line Number 19 -->
我使用的是 Windows。
I tried creating an XULRunner app as given in the tutorial - http://pyxpcomext.mozdev.org/no_wrap/tutorials/pyxulrunner/python_xulrunner_about.html
But when I tried running the app it gave me the following error -
XML Parsing Error:
Location: chrome://pyxpcom_gui_app/content/pyxpcom_gui_app.xul
Line Number 19, Column 48:
persist="screenX screenY width height">
-----------------------------------------------^
I am not getting what went wrong. Content of pyxpcom_gui_app.xul -
<window id="pyxpcom_gui_app"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&pyxpcom_gui_app.title;"
style="width: 700px; height: 500px;"
script-type="application/x-python"
persist="screenX screenY width height"> <!-- This is Line Number 19 -->
I am on Windows.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
鉴于您的代码似乎没有任何语法错误,最有可能的问题是
&pyxpcom_gui_app.title;
实体引用(请注意,Firefox 使用的 XML 解析器始终指向一个标签,无论它在哪一行找到未知实体)。您可能忘记包含定义此实体的 DTD 文件,或者该 DTD 文件的地址错误,或者它没有定义名为pyxpcom_gui_app.title
的实体。Given that your code doesn't seem to have any syntax errors, the most likely issue is the
&pyxpcom_gui_app.title;
entity reference (note that the XML parser used by Firefox always points to the end of a tag regardless of the line where it finds an unknown entity). Either you forgot to include the DTD file defining this entity or the address of that DTD file is wrong or it doesn't define an entity namedpyxpcom_gui_app.title
.这里同样的问题,但尚未解决。
如果在您的 DTD 中正确指定了 pyxpcom_gui_app.title 实体,并且您的 DTD 位于 chrome.manifest 中指定的位置,则问题出在 script-type="application/x-python" 行中(如果删除此行您将运行应用程序的 XUL 部分)。根据 Pyxpcomext 列表,该问题与 1.9.1 pythonext Windows 版本有关,如以下文档所述:
http://www.mozdev.org/pipermail/pyxpcomext/2009-March/000052.html
我已经尝试了最新的版本,但它们仍然无法工作。我会继续努力。
Same problem here, yet unsolved.
If the pyxpcom_gui_app.title entity is correctly specified in your DTD, and your DTD is located as specified in your chrome.manifest, then the problem is in the line script-type="application/x-python" (if you delete this line you'll get the XUL part of the application running). According to the Pyxpcomext list, the problem is related to the 1.9.1 pythonext Windows builds, as documented in:
http://www.mozdev.org/pipermail/pyxpcomext/2009-March/000052.html
I've tried out the newest builds but they still won't work. I'll keep trying.
假设这是整个文件,您需要关闭窗口标签。
Assuming that is the entire file, you need to close the window tag.