xsl-list
[Top] [All Lists]

Re: [xsl] RE: Troubling passing parameter to xsl:sort via ASP

2007-08-02 09:23:11
Jessica Hennessey wrote:

ASP Code:
Set objXmlHttp1 = Server.CreateObject("Msxml2.serverxmlhttp")
Set objDom = Server.CreateObject("MSXML2.FreeThreadedDOMDocument")
objXmlHttp1.send strSend

I miss some objXmlHttp1.open call here before the send call.


 set xslt = Server.CreateObject("MSXML2.XSLTemplate")
 set xslt.stylesheet = xsl
 Set xslProc = xslt.createProcessor()
 xslProc.input = objDom
 xslProc.addParameter "order", request("order")
 xslProc.transform
 sOutput = xslProc.output
 response.write sOutput

Not the reason why your approach does not work but consider using
  xsltProc.output = Response
  xsltProce.transform
here instead of transforming to a string sOutput and Response.writing that string. You will get much less problems with character encodings that way.

XSL Code:

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

<xsl:template match="/">
      <xsl:for-each select="root/job">
   <xsl:sort select="$order" order="ascending"/>

I think you want something alike
  <xsl:sort select="*[local-name() = $order]" order="ascending"/>
but I am guessing, consider showing use how your job elements look and what you want to order on.



--

        Martin Honnen
        http://JavaScript.FAQTs.com/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--