Andrew Dunstan <andrew@dunslane.net> writes:
> On 08/06/2010 12:15 PM, Tom Lane wrote:
>> Some examination of
>> http://www.xmlsoft.org/XSLT/tutorial/libxslttutorial.html
>> suggests that the parameter values need to be single-quoted,
>> and indeed when I change the last part of your example to
>>
>> 'n1=''v1'',n2=''v2'',n3=''v3'',n4=''v4'',n5=''v5'''::text);
> Which would look a whole lot nicer with dollar quoting ;-)
No doubt. But one would assume that constant parameters aren't going
to be the normal use-case, and dollar quoting isn't helpful for
nonconstant text.
I think there are issues here that we need to take a step back and think
about. Right now, thanks to the lack of documentation, we can probably
assume there are approximately zero users of the xslt_process parameter
feature. Once we document it that'll no longer be true. So right now
would be the time to reflect on whether this is a specification we
actually like or believe is usable; it'll be too late to change it
later.
There are two specific points bothering me now that I see how it works:
1. name = value pretty much sucks, especially with the 100% lack of any
quoting convention for either equals or comma. I concur with the
thoughts upthread that turning this into a variadic function would be a
more sensible solution.
2. I'm not sure whether we ought to auto-single-quote the values.
If we don't, how hard is it for users to properly quote nonconstant
parameter values? (Will quote_literal work, or are the quoting rules
different for libxslt?) If we do, are we giving up functionality
someone cares about?
regards, tom lane