On usefulness of p:www-form-urlencode

Hi all,

At its present form, p:www-form-urlencode step takes a set of parameters
from its parameter input port, URL encodes them (into a string in the
form "param1=value1&param2=value2&...") and then, similarly to
p:string-replace, replaces all matching nodes in the input document with
this string value.

I am wondering whether this is the best thing to do. In my opinion, in
most of the cases you want to inject full URLs (that is, something like:
"http://bla?param1=value2&...") in the document, not just encoded
parameters. As the spec stands now, you would need to use a sequence of
two p:string-replace like steps (p:www-form-urlencode +
p:string-replace):

- first, you encode and insert the parameters using
p:www-form-url-encode
- then you find the inserted values and prepend the server part using
p:string-replace

In my opinion, this is too inefficient and cumbersome (and possibly
unsafe in the second step as well).

Sorry that I bring up this issue again, but: what if
p:www-form-urlencode, p:uuid, p:hash just returned a simple c:result
document (containing the serialized parameters, or uuid, or hash)
instead of behaving as p:string-replace? In my opinion, this would give
us much more flexibility, because you could then do things like
assigning the content of c:result to a variable which you could then,
for instance, refer to in the "replacement" option in p:string-string
replace. It would also seem cleaner to me.

Regards,
Vojtech

Received on Monday, 8 December 2008 08:22:58 UTC