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

using parameters in filters?

Subject: using parameters in filters?
From: "Mattias Konradsson" <preacher@xxxxxxxxxxx>
Date: Fri, 23 Feb 2001 17:58:49 +0100
xslt filtering using parameters
I'm doing a solution where you can filter a clientside view of xml data  on
the fly.. using MSXML3. The problem I'm having is that it doesnt seem to
work to pass the filter criteria as a parameter, maybe someone can tell me
what i'm doing wrong

Javascript:

function init()
 {
  var xslProc;
  var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
  var xslt = new ActiveXObject("Msxml2.XSLTemplate");
  xslDoc.async = false;
  xslDoc.load(stylesheet);
  xslt.stylesheet = xslDoc;
  xmlDoc.async = false;
  xmlDoc.loadXML(inbox.xml);
  xslProc = xslt.createProcessor();
  xslProc.addParameter("filter", "@repliedto = 'False'");
  xslProc.addParameter("sortby", "@messageid");

  xslProc.input = xmlDoc;
  xslProc.transform();

  messages.innerHTML = xslProc.output
  }

stylesheet:

  <xsl:apply-templates select="message[$filter]" />

I know for a fact that the parameter gets passed correctly and that the
result giving the correct parameter should work.. but it simply shows all
the elements
when I use the param. If I instead try to set the param to
message[@repliedto = 'False'] and  use   <xsl:apply-templates
select="$filter" />    I get an error message saying something akin to
"variable or parameter must evaluate to a nodelist".


Best Regard
---
Mattias Konradsson


 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.