On 1/5/06, Josias Thoeny <[EMAIL PROTECTED]> wrote:
> On Wed, 2006-01-04 at 18:28 -0500, [EMAIL PROTECTED] wrote:
> > Can we make the module a generic "function" ability?  Can it accept
> > multiple parameters?
> > {function:functionName:parameter1:parameter2,...}
> > {function:convert-iso8602-rfc822:{page-envelope:document-lastmodified}}
> > {function:substring-before:mylongstring:ring}  = "mylongst"
> > I had several issues that could have been quickly solved by "standard"
> > functions such as string manipulation in the XMAPs.  I am certain that
> > if such a framework exists, it will quickly be filled with most of the
> > "standards".
>
> I agree that it would be nice have e.g. string functions in the sitemap.
> But it seems to me this approach would mean to invent a new expression
> language. I'm not sure if that's a good idea, because cocoon contains a
> lot of expression languages already (Xpath, JEXL, etc).
> XPath can be used in input-modules, and you can for example do string
> operations by (mis-)using any input module which extends
> AbstractJXPathModule [1]. An example with the SessionModule:
> {session:substring-after('{page-envelope:document-id}','/')}
>
> Note: this expression has nothing to do with the session, it just uses
> the xpath capability of the session module.
> It would be easy to turn this into a cleaner solution by using a new
> input module which extends AbstractJXPathModule instead of the session
> module.
>
> Probably this approach is not very useful for more complicated stuff
> like a date conversion.
> What about using xpath for simple things and specific modules for more
> complicated tasks?
> WDYT?
> Josias
> [1] http://cocoon.apache.org/2.1/apidocs/index.html

Thanks.  I did not know there was a method for accessing string
functions.  I wish I had known about that 6 months ago.  Now I have to
revise my "Useful Commands for XMAPs" page.

That seems useful for the "standard" functions.  Should the date
conversion functions be added to a new module for all non-standard
functions?  Should there be a dataConversion module?  Or can they be
added to SessionModule?

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to