我正在为我的Plone站点开发一个新的插件,因此它显示了我在
configure.zcml : unbound prefix.在这里,我正在编写zcml代码:
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:five="http://namespaces.zope.org/five"
xmlns:i18n="http://namespaces.zope.org/i18n"
i18n_domain="customer.reports">
<five:registerPackage package="." initialize=".initialize" />
<include package="plone.resource" file="meta.zcml"/>
<plone:static
directory="templates"
type="reports"
name="customer"
/>
</configure>下面提到的未绑定前缀错误。
文件"/Plone/Python-2.7/lib/python2.7/xml/sax/handler.py",第38行,在fatalError中引发异常zope.configuration.xmlconfig.ZopeXMLConfigurationError:文件"/Plone/zinstance/parts/instance/etc/site.zcml",行16.2-16.23 ZopeXMLConfigurationError:"/Plone/buildout-cache/eggs/Products.CMFPlone-4.3-py2.7.egg/Products/CMFPlone/configure.zcml",文件行98.4-102.10 ZopeSAXParseException: File ZopeSAXParseException第13.2行,未绑定前缀
发布于 2016-02-08 06:00:15
此错误表示您缺少configure.zcml顶部的命名空间声明。尝试在配置标记中包括以下内容之一:
xmlns:plone="http://namespaces.plone.org/plone"在此之前,我在代码中添加了一行以修复未绑定错误,我使用plone注册了我的外接程序,但没有声明正确的命名空间,即zcml文件的名称空间声明块中的plone。
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:five="http://namespaces.zope.org/five"
xmlns:i18n="http://namespaces.zope.org/i18n"
xmlns:plone="http://namespaces.plone.org/plone"
i18n_domain="customer.reports">
<five:registerPackage package="." initialize=".initialize" />
<!-- -*- extra stuff goes here -*- -->
<include package="plone.resource" file="meta.zcml"/>
<plone:static
directory="templates"
type="reports"
name="customer"
/>
</configure>发布于 2016-02-08 05:59:56
您的代码没有定义在元素plone中使用的前缀plone:static。您可能需要在某个地方添加相应的命名空间声明,例如在configure元素:xmlns:plone="http://namespaces.plone.org/plone"中。
https://stackoverflow.com/questions/35263168
复制相似问题