cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject RE:xsp code sample
Date Thu, 13 Jan 2000 20:37:39 GMT
On Wed, 12 Jan 2000, Ricardo Rocha wrote:

> Donald Ball wrote:
> > how does the XSP Processor determine the order in which to process the
> > XSP-enabled namespace elements that occur inside an <xsp:page> element in
> > an XML document? E.g. if I want processing of the 'request' namespace to
> > occur before processing of the 'sql' namespace, how do I ensure that that
> > will occur?
> 
> This is dictated by the order of appearance of the (library) namespace
> declarations inside the <xsp:page> root element. For example, in:
> 
>     <xsp:page language="java"
>       xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>       xmlns:request="http://www.apache.org/1999/XSP/Request"
>       xmlns:sql="http://www.apache.org/1999/XSP/Sql"
>      >
> 
> the "request" logicsheet will be applied _before_ "sql". Note, though,
> that the "xsp" namespace is treated specially: it comes last regardless
> of its position in the namespace list.
> 
> > What if I want the same namespace to be processed twice, with
> > another namespace process pass between the two? Mind you, I can't think of
> > an instance where that would be desirable offhand, but I think
> > understanding the answer would help my comprehension of the flow control.
> 
> Oh, my friend! This very question has been tormenting me for a while.
> Remember the old Unix days when you'd have to specify a C library
> more than once in your cc/ld command line, precisely because of the
> same problem? ("malloc.a" would typically need multiple inclusions)

Showing your age, you are.

> There are cases in which inter-library dependencies don't yield a
> _single_ topological ordering. Granted, such cases are not common,
> but they may occur and we have to account for them.

[ suggestions snipped ]

I have an even simpler suggestion - don't register the namespace prefixes
in cocoon.properties, register the namespaces themselves. Then you can do
processing runs over documents that look like this:

<page>
 <xsp:page language="java"
  xmlns:xsp="http://www.apache.org/1999/XSP/Core"
  xmlns:cookie="http://www.apache.org/1999/XSP/Cookie"
  xmlns:sql="http://www.apache.org/2000/SQL"
  xmlns:cookie2="http://www.apache.org/1999/XSP/Cookie"
 >
 ...
 </xsp:page>
</page>

But perhaps I misunderstand something?

Anyway, your suggestion for specifying XSP taglibs via PIs is possibly
good, but should be optional, IMHO. Much easier for the site admin to add
them once in cocoon.properties.

- donald


Mime
View raw message