On 11/02/2013 15:08, Mansour Al Akeel wrote:
I started using 3.0.0-beta-1-SNAPSHOT. I was prototyping with 3.0.0-alpha-3.
However, I wrote a few readers where I can pass parameters as an
attribute in the sitemap:

For example:

<map:read type="myReader" id="{map:1}" lang="{map:2}" prop="{global:myProp}" />


After I switched to beta-1 I started getting:

8:54:14.567 [btpool0-1] ERROR o.a.cocoon.servlet.XMLSitemapServlet -
Can't initialize the RequestProcessor correctly.
org.apache.cocoon.sitemap.SitemapBuilder$SitemapBuilderException:
Can't build sitemap from
file:/home/mansour/workspace/........./contents-filesystem/src/main/resources/COB-INF/sitemap.xmap
        at 
org.apache.cocoon.sitemap.SitemapBuilder.build(SitemapBuilder.java:70)
~[cocoon-sitemap-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
        at 
org.apache.cocoon.servlet.RequestProcessor.initializeSitemap(RequestProcessor.java:203)
~[cocoon-servlet-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
        at 
org.apache.cocoon.servlet.RequestProcessor.<init>(RequestProcessor.java:83)
~[cocoon-servlet-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
        at 
org.apache.cocoon.servlet.XMLSitemapServlet.lazyInitialize(XMLSitemapServlet.java:68)
[cocoon-servlet-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
        at 
org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:46)
[cocoon-servlet-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
.....
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2:
Attribute 'id' is not allowed to appear in element 'map:read'.
        at 
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
~[na:1.6.0_37]
        at 
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
~[na:1.6.0_37]
        at 
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
~[na:1.6.0_37]
        at 
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
~[na:1.6.0_37]


Is there something I need to change to allow parameters to be passed
in the same way ??

Hi Mansour,
you are experiencing this issue because up to 3.0.0-alpha-3 the sitemap.xmap wasn't validated against the sitemap XSD, hence you were able to use non-standard attributes.

I'd suggest to change

<map:read type="myReader" id="{map:1}" lang="{map:2}" prop="{global:myProp}" />

into standard form, e.g.

<map:read type="myReader">
  <map:parameter name="id" value="{map:1}"/>
  <map:parameter name="lang" value="{map:2}"/>
  <map:parameter name="prop" value="{global:myProp}"/>
</map:read>

The parameters can be read in the same way I've suggested earlier today [2].

Regards.

[1] https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/resources/cocoon-sitemap-1.0.xsd
[2] http://markmail.org/message/jd3tbjuz3uz3ipl7

--
Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org

Reply via email to