2

I have a Plone 4 with plone.app.theming(Diazo) installed and I am having problem when I am using a zip file theme through Diazo Control Panel.

I had tried for many times to identify the cause of the error showed in the Plone log bellow:

2011-07-10 20:20:55 ERROR plone.transformchain Unexpected error whilst trying to apply transform chain
Traceback (most recent call last):
  File "/opt/Plone4/buildout-cache/eggs/plone.transformchain-1.0-py2.6.egg/plone/transformchain/transformer.py", line 42, in __call__
    newResult = handler.transformIterable(result, encoding)
  File "/opt/Plone4/buildout-cache/eggs/plone.app.theming-1.0b8-py2.6.egg/plone/app/theming/transform.py", line 205, in transformIterable
    transform = self.setupTransform()
  File "/opt/Plone4/buildout-cache/eggs/plone.app.theming-1.0b8-py2.6.egg/plone/app/theming/transform.py", line 150, in setupTransform
    xsl_params=xslParams,
  File "/opt/Plone4/buildout-cache/eggs/diazo-1.0rc3-py2.6.egg/diazo/compiler.py", line 106, in compile_theme
    read_network=read_network,
  File "/opt/Plone4/buildout-cache/eggs/diazo-1.0rc3-py2.6.egg/diazo/rules.py", line 160, in process_rules
    rules_doc = fixup_themes(rules_doc)
  File "/opt/Plone4/buildout-cache/eggs/diazo-1.0rc3-py2.6.egg/diazo/utils.py", line 49, in __call__
    result = self.xslt(*args, **kw)
  File "xslt.pxi", line 568, in lxml.etree.XSLT.__call__ (src/lxml/lxml.etree.c:120289)
XSLTApplyError: xsltValueOf: text copy failed

I would be very grateful if you could help me?

Thanks in advance,

Alano

Dimitre Novatchev
  • 240,661
  • 26
  • 293
  • 431
user838067
  • 53
  • 3
  • 1
    Error reporting is one of the current weaknesses of Diazo. Please can you email me the zip file with your theme and I'll take a look - l at lrowe dot co dot uk. (I maintain Diazo and plone.app.theming.) – Laurence Rowe Jul 11 '11 at 12:36
  • That zip file works for me. It sounds like you have a problem with lxml. What version do you have installed? I suggest running the diazo tests (buildout file in diazo distribution.) – Laurence Rowe Jul 11 '11 at 16:58
  • After a yum command: Name: python-lxml / Arch: x86_64 / Version: 2.0.11/ Release: 1.el5. How can I run diazo tests? I apologize if this question is basic. – user838067 Jul 11 '11 at 18:04
  • After a buildout command: We have the distribution that satisfies 'lxml==2.3' – user838067 Jul 11 '11 at 18:44
  • please include the error information provided by lxml.etree.XMLSchema('').error_log See: https://lxml.de/xpathxslt.html#errors-and-messages – dank8 Feb 21 '23 at 01:35

4 Answers4

2

I downloaded Plone 4.1 installer from Launchpad (http://launchpad.net/plone/4.1/4.1rc3/+download/Plone-4.1rc3-UnifiedInstaller-Hotfix-20110622.tgz) and reinstall Plone 4. The problem mentioned did occur. Diazo works perfectly for while.

My old Plone 4.1 installation was upgraded from a Plone 4.0.7 installation and there were any conflicts or something like that in the packages installed.

user838067
  • 53
  • 3
1

Sounds like you have a bad rule in your rules file. Backup your rules file, then remove lines one by one until the problem disappears. Then you'll know which line is causing the problem. Read the docs for that rule again to check if you are missing some necessary part.

Dan Jacka
  • 1,782
  • 1
  • 15
  • 25
  • I follow your instructions but I am not having sucess. – user838067 Jul 11 '11 at 02:07
  • In fact, my rules.xml is very simple. Follow bellow: rules xmlns="http://namespaces.plone.org/diazo" xmlns:css="http://namespaces.plone.org/diazo/css" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> – user838067 Jul 11 '11 at 02:08
  • 1
    @user838067 Please edit your original question to provide more information e.g. is this a theme you've created yourself? how did you install Diazo? It's hard to help otherwise. – Dan Jacka Jul 11 '11 at 07:23
1

I encountered precisely the same issue with precisely the same error message.

This was on a system with libxml2 2.6.26 and libxslt 1.1.17.

Upgrading libxml2 to 2.7.8 and libxslt to 1.1.26 made the message go away and my Diazo rules began working correctly.

If you're using zc.buildout (and you should be), you can get along extremely quickly with the "z3c.recipe.staticlxml" recipe. Just add a "lxml" part to your buildout with the following configuration:

[lxml]
recipe = z3c.recipe.staticlxml
egg = lxml

Delete all existing lxml eggs you may have before running the buildout.

nutjob
  • 51
  • 3
0

Error in package \lxml\xslt.pxi can indicate fault with xslt tempalte, processing errors can be extracted from property transform.error_log. An example:

import lxml
import lxml.etree
xmlPath = '/path/data.xml'
xslPath = '/path/template.xlst'
xslRoot = lxml.etree.parse(xslPath)
transform = lxml.etree.XSLT(xslRoot)
xmlDoc = lxml.etree.parse(xmlPath)
try:
    resultDoc = transform(xmlDoc)
except:
    pass
for entry in transform.error_log:
    print('file', entry.filename 
        , entry.line, entry.column, entry.message
        , entry.domain_name, entry.domain)
        , entry.type_name, entry.type)
        , entry.level_name, entry.level)

Source: errors-and-messages (lxml.de)

dank8
  • 361
  • 4
  • 20