This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

using parameters in filters?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]