Jeff Turner wrote:

Hi,

Currently, if the treeprocessor encounters any nodes outside the
'http://apache.org/cocoon/sitemap/1.0' namespace, it throws an exception.

I would like to modify this behaviour to simply ignore non-Cocoon
elements.


My use-case is that in Forrest, I'd like to document our numerous sitemaps with some embedded XML:

<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0";
xmlns:doc="http://apache.org/forrest/documentation/1.0";>


<snip/>

Anyone mind if I make this (one-line) change?



Although this sounds good, what about sitemap validation ? Can we tell RNG to ignore foreign namespaces ? Also, I envision some problems if we use these foreign namespaces in the <map:components> section, which is the xconf of a ComponentManager.


A possible solution is to filter any element or attribute having a namespace different than "" or the sitemap namespace from what is used by the TreeProcessor to build the sitemap. But this prevents components using namespaced configurations (AFAIK we haven't any as of today).

Or we could also filter the opposite way : configure the TreeProcessor with a list of allowed foreign namespaces that are ignored, any other namespace being considered as an error.

Sylvain

--
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com




Reply via email to