You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Jeff Turner <je...@apache.org> on 2003/07/06 09:15:09 UTC
Allow non-Cocoon elements in sitemap?
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">
<x:doc>
<x:desc>
'faq' pipelines. Implements source XML, body HTML and output PDF pipelines.
Handles different FAQ DTD versions by sniffing the DOCTYPE, and
applying an appropriate transformation.
</x:desc>
<x:generates>
Source XML, body HTML, output PDF
</x:generates>
<x:example href="http://localhost:8888/faq.xml">Source XML for FAQ</x:example>
<x:example href="http://localhost:8888/body-faq.html">Body HTML for FAQ</x:example>
<x:example href="http://localhost:8888/faq.pdf">PDF of FAQ</x:example>
<x:usedby>sitemap.xmap, which binds these generic pipelines to URLs.</x:usedby>
<x:uses>content/xdocs/**.xml, depending on URL binding.</x:uses>
</x:doc>
...
And perhaps some Ant-like 'description' attributes:
<map:match pattern="abs-linkmap"
x:description="site.xml with @href's appended to be context-relative.">
With the option of taking this to silly 'literate programming'
extremes :)
Anyone mind if I make this (one-line) change?
--Jeff
Re: Allow non-Cocoon elements in sitemap?
Posted by Sylvain Wallez <sy...@anyware-tech.com>.
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