[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

passing params using asp into wml

Subject: passing params using asp into wml
From: "Andrew Welch" <andrew@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 9 Apr 2001 14:08:37 +0100
asp with wml
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.