python - lxml:未知的 includemode 或 @method 属性

标签 python plone lxml diazo

我已经设置了 Diazo在新的 Ubuntu 12.04LTS 上 Vagrant框,使用以下步骤:

  1. apt-get 更新
  2. apt-get install python-setuptools
  3. apt-get install build-essential python2.7-dev libxslt1-dev
  4. easy_install -U diazo
  5. 按照 Diazo Quickstart 中的说明进行操作(添加最新的 bootstrap.py )

快速入门中的 Diazo 示例运行良好(将 read_network = true 少量添加到 [filter:theme])。

但是,当我添加我现有的项目(在其他机器上工作)时,我在尝试查看站点时从 bin/paster serve 收到以下错误

Exception happened during processing of request from ('192.168.33.1', 50171)
Traceback (most recent call last):
  File "/home/vagrant/test/eggs/Paste-1.7.5.1-py2.7.egg/paste/httpserver.py", line 1068, in process_request_in_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.7/SocketServer.py", line 638, in __init__
    self.handle()
  File "/home/vagrant/test/eggs/Paste-1.7.5.1-py2.7.egg/paste/httpserver.py", line 442, in handle
    BaseHTTPRequestHandler.handle(self)
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
    self.handle_one_request()
  File "/home/vagrant/test/eggs/Paste-1.7.5.1-py2.7.egg/paste/httpserver.py", line 437, in handle_one_request
    self.wsgi_execute()
  File "/home/vagrant/test/eggs/Paste-1.7.5.1-py2.7.egg/paste/httpserver.py", line 287, in wsgi_execute
    self.wsgi_start_response)
  File "/home/vagrant/test/eggs/Paste-1.7.5.1-py2.7.egg/paste/urlmap.py", line 203, in __call__
    return app(environ, start_response)
  File "/home/vagrant/test/eggs/diazo-1.0b1-py2.7.egg/diazo/wsgi.py", line 353, in __call__
    transform_middleware = self.get_transform_middleware()
  File "/home/vagrant/test/eggs/diazo-1.0b1-py2.7.egg/diazo/wsgi.py", line 342, in get_transform_middleware
    tree=self.compile_theme(),
  File "/home/vagrant/test/eggs/diazo-1.0b1-py2.7.egg/diazo/wsgi.py", line 337, in compile_theme
    xsl_params=xsl_params,
  File "/home/vagrant/test/eggs/diazo-1.0b1-py2.7.egg/diazo/compiler.py", line 106, in compile_theme
    read_network=read_network,
  File "/home/vagrant/test/eggs/diazo-1.0b1-py2.7.egg/diazo/rules.py", line 164, in process_rules
    rules_doc = annotate_rules(rules_doc)
  File "/home/vagrant/test/eggs/diazo-1.0b1-py2.7.egg/diazo/utils.py", line 49, in __call__
    result = self.xslt(*args, **kw)
  File "xslt.pxi", line 556, in lxml.etree.XSLT.__call__ (src/lxml/lxml.etree.c:110044)
XSLTApplyError: 
            ERROR: Unknown includemode or @method attribute

我已经尝试设置 deployment docs 中建议的不同 includemodes , 没有成功。

除了我的扩展规则外,我的项目和演示之间(目前)唯一的区别是我包含了 xmlns:xi="http://www.w3.org/2001/XInclude"

是什么导致了错误,如何解决?

最佳答案

我在 lxml 遇到了同样的问题。 尽量不要在您的 xml 文件中包含任何内容。 而是将代码直接写入文件。

我还是不明白为什么会这样!!

希望它能给你一个线索..

关于python - lxml:未知的 includemode 或 @method 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16739449/

相关文章:

python - 如何使用 SciPy/NumPy 从图像中查找和删除白色 Blob ?

python - 在 ipython qtconsole 中打印粗体、彩色等文本

tinymce - Plone - TinyMCE 编辑器 - 双行间距而不是单行间距的换行符

python - Plone 4 : Passing arguments to view class (BrowserView)

javascript - 根据 IP 地址隐藏或显示 div 元素

python - 获取lxml中元素的内部HTML

python - 迷失在 XML 和 Python 中

python - 使用 GroupBy 将新列添加到数据框

python - MLPClassifier参数设置

python - 使用 python 解析 HTML 表 - HTMLparser 或 lxml