[xsl] passing params using asp into wml

Subject: [xsl] passing params using asp into wml
From: "Andrew Welch" <andrew@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 9 Apr 2001 14:08:37 +0100
Hi,

Im still struggling to setup searching in wml.  A user selects a link from a
page of wml, which sends a parameter to some asp.  The asp then passes the
parameter to a stylesheet using ixslprocessor (I think :-)  The error Im
getting is:

'The parameter is incorrect' line 11 searchwml.asp

I do something very similar for searching xml on the client side, which
works, but uses msxml v3 objects.  The host Im using reckons they have
installed msxml3, but if I use version specific prog ids, nothing works at
all!

Can anybody point out where Im going wrong??

Many thanks

Andrew

A link to this file takes the form '...searchwml.asp?param1=xxx'
===searchwml.asp===
<% Response.Buffer=True %>
<%
   Dim xsl
   Dim template

   Set xsl = Server.CreateObject("Microsoft.FreeThreadedXMLDOM")
   xsl.async = false
   xsl.load (Server.MapPath("/xsl/searchwml.xsl"))

   Set template = Server.CreateObject("Msxml2.XSLTemplate")
   template.stylesheet = xsl
   processor = template.createProcessor()

   processor.input = xml
   processor.addParameter "param1",Request.QueryString("param1")
   processor.transform()

   Response.ContentType = "text/vnd.wap.wml"
   Response.Write "<?xml version=""1.0"" ?>"
   Response.Write "<!DOCTYPE wml PUBLIC ""-//WAPFORUM//DTD " & _
                  "WML 1.1//EN""
""http://www.wapforum.org/DTD/wml_1.1.xml"";>"

   Response.write (processor.output)
%>

===searchwml.xsl===
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:param name="param1"/>
<xsl:param name="PARAM1"
select="translate(translate(translate(translate($param1, $lowercase,
$uppercase),' ',''),'.',''),$apos,'')"/>

<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="apos">'</xsl:variable>

<xsl:variable name="results"
select="TBD/business[*[contains(translate(translate(translate(translate(.,
$lowercase, $uppercase),' ',''),'.',''),$apos,''),$PARAM1)]]" />


<xsl:template match="/">
  <wml>
    <card id="index" title="-The Bristol Dir-" newcontext="true">
      <xsl:for-each select="$results">
        <a><xsl:attribute name="href">wtai://wp/mc;<xsl:value-of
select="telephone"/></xsl:attribute><xsl:value-of select="name"/></a><br/>
      </xsl:for-each>
    </card>
  </wml>
</xsl:template>

</xsl:stylesheet>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread