首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Plone : configure.zcml中的未绑定前缀

Plone : configure.zcml中的未绑定前缀
EN

Stack Overflow用户
提问于 2016-02-08 05:54:06
回答 2查看 422关注 0票数 2

我正在为我的Plone站点开发一个新的插件,因此它显示了我在

代码语言:javascript
复制
configure.zcml : unbound prefix.

在这里,我正在编写zcml代码:

代码语言:javascript
复制
    <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行,未绑定前缀

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-02-08 06:00:15

此错误表示您缺少configure.zcml顶部的命名空间声明。尝试在配置标记中包括以下内容之一:

代码语言:javascript
复制
 xmlns:plone="http://namespaces.plone.org/plone"

在此之前,我在代码中添加了一行以修复未绑定错误,我使用plone注册了我的外接程序,但没有声明正确的命名空间,即zcml文件的名称空间声明块中的plone。

代码语言:javascript
复制
<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>
票数 5
EN

Stack Overflow用户

发布于 2016-02-08 05:59:56

您的代码没有定义在元素plone中使用的前缀plone:static。您可能需要在某个地方添加相应的命名空间声明,例如在configure元素:xmlns:plone="http://namespaces.plone.org/plone"中。

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35263168

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档