You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jorg Heymans <Jo...@12snap.com> on 2003/08/04 17:53:02 UTC
regex transformer
Hi all,
I would need some sort of search and replace functionality for my XML
templates, resorting to XSLT for this seems beyond my reach.
Basically if a template contains
<test>
<url value=http://mycom.com/?param=myparam <http://mycom.com/?param=myparam>
/>
<title value="myparam"/>
</test>
Then I would like to replace all occurrences of myparam with a value of my
own. How would this fit into cocoon? Should I be looking at creating my own
transformer eg:
<map:transform type="regex">
<map:parameter regex="s/myparam/myvalue/g">
or
<map:parameter op="replace" what="myparam" with="myvalue"/>
</map:transform>
Does this seem all too crazy? Is there a better way of doing this?
Rgds
Jorg
Re: regex transformer
Posted by Joose Vettenranta <jo...@iki.fi>.
On ma, 2003-08-04 at 18:53, Jorg Heymans wrote:
Hi,
> Then I would like to replace all occurrences of myparam with a value
> of my own. How would this fit into cocoon? Should I be looking at
> creating my own transformer eg:
are you sure you want to do that? there is something in xslt-which you
can implement to do some very basic search & replace...
> <map:transform type="regex">
> <map:parameter regex="s/myparam/myvalue/g">
I started coding this sort of a transformer because at the end of one
project I will need it. Currently it is not working. It is not difficult
to implement.
- Joose
--
Joose Vettenranta <jo...@iki.fi> GSM: 044 561 0270
* Always remember that you are unique.
Just like everyone else.*
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org