Jon Hadley
Jon Hadley

Reputation: 5296

lxml: Unknown includemode or @method attribute

I've setup Diazo on a fresh Ubuntu 12.04LTS Vagrant box, using the following steps:

  1. apt-get update
  2. apt-get install python-setuptools
  3. apt-get install build-essential python2.7-dev libxslt1-dev
  4. easy_install -U diazo
  5. Followed the instructions in Diazo Quickstart (adding the latest bootstrap.py)

The Diazo example in the Quickstart works fine (with the minor addition of read_network = true to [filter:theme]).

However, when I add my existing project (that works on other machines), I get the following error from bin/paster serve when trying to view the site

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

I'ved tried setting different includemodes suggested in the deployment docs, with no success.

The only other difference between my project and the demo that I can (currently) spot, other than my extended rules, is that I include xmlns:xi="http://www.w3.org/2001/XInclude"

What is causing the error and how can fix it?

Upvotes: 5

Views: 253

Answers (1)

Manuj Rastogi
Manuj Rastogi

Reputation: 347

i faced somehow same problem with lxml . try not to include anything in your xml file. but write the code directly into the file.

i still dont why this happens !!

Hope it gives you a lead ..

Upvotes: 0

Related Questions