Plone : unbound prefix in configure.zcml

480 views Asked by At

I am developing a new add-on for my Plone site so as a result it showing my an error in

configure.zcml : unbound prefix.

Here i am writing my zcml code :

    <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>

Unbound prefix error mentioned as below.

File "/Plone/Python-2.7/lib/python2.7/xml/sax/handler.py", line 38, in fatalError raise exception zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/Plone/zinstance/parts/instance/etc/site.zcml", line 16.2-16.23 ZopeXMLConfigurationError: File "/Plone/buildout-cache/eggs/Products.CMFPlone-4.3-py2.7.egg/Products/CMFPlone/configure.zcml", line 98.4-102.10 ZopeSAXParseException: File "/Plone/zinstance/src/customer.reports/customer/reports/configure.zcml", line 13.2, unbound prefix

2

There are 2 answers

4
Bharti Rawat On BEST ANSWER

This error indicates that you're missing a namespace declaration at the top of your configure.zcml. Try including one of the following in the configure tag:

 xmlns:plone="http://namespaces.plone.org/plone"

As i added above line in my code to fix unbound error before this i was using plone to register my add-on but not declare the correct namespace i.e. plone at the name space declaration block of zcml file

<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>
0
Alexander Kogtenkov On

Your code does not define a prefix plone that you are using in the element plone:static. You may need to add the corresponding namespace declaration somewhere, e.g. in the configure element: xmlns:plone="http://namespaces.plone.org/plone".