Hi Kjetil,Maybe you could use the LinkRewriterTransformer [1] to achieve this along with your own custom InputModule to add the locale parameter.
That said, the LinkRewriterTransformer looks up the InputModule based on the url scheme, so you would have to use a custom scheme (e.g. locale:) for all the 'schemeless' (e.g. "/path/to/some/page.html") links you wanted rewritten.
Robin 1. http://cocoon.apache.org/2.2/blocks/linkrewriter/1.0/1102_1_1.html On 31 Jul 2008, at 16:41, Kjetil Kjernsmo wrote:
Hi all,I've been struggling a few days with adding a locale parameter to the local URLs in pages I serve. It should be really simple, just add the parameter to all hrefs that points to a resource within the site. I've tried to do it with XSLT through various approaches, but all unsuccessful, it is either very fragile string matching, too fragile to be useful, or too complicated, inthat it breaks my architecture.However, I see that the EncodeURLTransformer is doing almost the same thing. It add a session-id parameter if it is doesn't exist, mine should add alocale parameter if it doesn't exist.EncodeURLTransformer are 400 lines of code though, some of which I don't understand, so I'm hesitant to hack based on it. For one thing, I don't understand if it restricts the URL rewriting to URLs that point to resourceson the same site, and if so, how it does it.So, I was wondering if someone has time to hold my hand while doing this? Also, this might be useful for the Cocoon project, as I think it is really important for LocaleAction to be useful, it's request feature is really quiteuseless without such a transformer. Please? Kind regards Kjetil Kjernsmo -- Senior Knowledge Engineer Direct: +47 6783 1136 | Mobile: +47 986 48 234 Email: [EMAIL PROTECTED] Web: http://www.computas.com/ | SHARE YOUR KNOWLEDGE |Computas AS Vollsveien 9, PO Box 482, N-1327 Lysaker | Phone:+47 6783 1000 |Fax:+47 6783 1001 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
smime.p7s
Description: S/MIME cryptographic signature