XSLT encoding of document command

I’ve a problem running a Tamino Query in a Stylesheet with the document function.
My stylesheet produces at the end a PDF-File.

<xsl:variable name=“SPONSOR” select=“document(concat($STRTAMINOURL,‘?_xql=Sponsor[SPID=’, ., ‘]’))”/>

The error is:
i_functions.xsl, Line 12; Column 63:
Query string contains invalid character: [

Why is this ‘[’ character not valid. How can I encode it?

Please find enclosed the relevant files.
The file list_tours1.xml is boud to Detail_d.xsl, which itself runs i_Detail.xsl
The document command is built in i_fuctions.xsl, there the failure occurs!

technically the characters “[” and “]” are not permitted characters in a URL and should be escaped as %HH (I think it’s %5B and %5D). It seems you are trying to send the URI via some software that’s actually insisting on this.

Michael Kay