I'm constructing a URL in XSL to use as a reference to an external
XML fragment in document() call. I need to encode the parameters used
in the URL (space to %20 for example). These parameters are pulled in
from an XML file which are not URL encoded. I was wondering what the
generally used solution to this problem is when using Xalan (XSLTC
engine). From what I can tell, Xalan doesn't have a built in
encodeURL type function.
I probably miss something here but whats wrong with
java.net.URLEncoder? Also, XML-escaping here is probably irrelevant as
you probably obtain the params using an XML API that hides how the
params are escaped in the XML.
hth,
Manos
Well, I'm constructing a URL in XSL - hence not in Java - I guess I
could use the support in Xalan to call any Java method, but this isn't a
great solution. Secondly, although the params I'm pulling in from the
XML file are XML-escaped, they are not URL encoded, so this does cause a
problem when forming URLs using them.