[Home] [By Thread] [By Date] [Recent Entries]
This is not strictly on-topic - however, my experience is that
parameters are best handled outside of XSL (and server-side if possible)
The following function removes certain request parameters (in this example, those suffixed with .x or .y) & reassembles & reloads the URL without them. Maybe you can adapt it for your needs. function delparam() { var oldurl = parent.document.location.href; var qparts = oldurl.split("?"); var newurl = qparts[0]; if (qparts.length > 1) { // remove any "rqop" parameter, or operations will be repeated var vars = qparts[1].split("&"); var sep = "?"; for (var i=0; i < vars.length; i++) { var parts = vars[i].split("="); if ((parts[0].substr(parts[0].length-2) == ".x") || (parts[0].substr(parts[0].length-2) == ".y")) { // do nothing } else { newurl += sep+ parts[0]+ "="+ parts[1]; sep = "&"; } } } parent.document.location.href = newurl; } Server-side, I use the following approach: This snippet is JSP but I imagine that you can adapt it as well. It excises the parameters named in "list" and returns the others in a <request> tag for further processing by XSL. <c:set var="list" value="${fn:split('spr,sprname,listinterval,listsrc', ',')}" /> <c:set var="listplus" value="${fn:join(list,',')}," /> <request> <c:forEach var="par" items="${paramValues}"> <c:forEach var="value" items="${par.value}"> <c:set var="keyplus" value="${par.key}," /> <c:if test="${not fn:contains(listplus, keyplus)}"> <jsp:element name="${par.key}">${value}</jsp:element> </c:if> </c:forEach> </c:forEach> </request> miouge@xxxxxxxxxxx wrote:
|

Cart



