Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: conflicting operators >Thread Next - Re: conflicting operators Re: conflicting operatorsTo: NULL Date: 6/7/2004 2:50:00 PM Change your filters to
<xsl:apply-templates
select="general/data/rows/row/*[name()=$field1 and
starts-with(@value,$filter1)]/../*[name()=$field2 and
not(starts-with(@value,$filter2))]/.."
mode="tableData" />
</xsl:variable>
and it will work
starts-with("foo", "foo") returns true
Yan
"Sharon Steringa" <esdeees@h...> wrote in message
news:OO8wJpGTEHA.544@T......
> Blimey, me post's too long. Here's the HTML again...
> <html><head>
> <script language="JavaScript">
> //Global variables
> var strXSLFileName,strXMLFileName;
> var objXMLDoc, objXSLDoc, objXSLTemplate;
> var currentSortDirection = "ascending";
> var currentSortCol = "";
>
> //HARDCODED VALUES-------------------
> strXMLFileName="test.xml"; // XML Data
> strXSLFileName="Render.xsl"; // XSL to build table
> //---------------------------------
>
> function DoInit()
> {
> objXMLDoc = new ActiveXObject("MSXML2.DomDocument");
> objXMLDoc.async = false;
> objXMLDoc.setProperty("SelectionLanguage", "XPath");
> objXMLDoc.resolveExternals = false;
> objXMLDoc.validateOnParse = false;
> objXMLDoc.load(strXMLFileName);
>
> objXSLDoc = new ActiveXObject
> ("MSXML2.FreeThreadedDomDocument");
> objXSLDoc.async = false;
> objXSLDoc.resolveExternals = false;
> objXMLDoc.validateOnParse = false;
> objXSLDoc.load(strXSLFileName);
> objXSLTemplate = new ActiveXObject("MSXML2.XSLTemplate");
> objXSLTemplate.stylesheet = objXSLDoc;
>
> renderData('fusername');
> }
>
>
> function renderData(strSort)
> {
> var objXSLProcessor;
> objXSLProcessor = objXSLTemplate.createProcessor();
> objXSLProcessor.input = objXMLDoc;
>
>
> // Toggle the sort direction only if necessary
> if (strSort == currentSortCol)
> {
> //strSort is CurrentSortCol
> if (currentSortDirection =="descending")
> {
> currentSortDirection = "ascending";
> }
> else
> {
> currentSortDirection = "descending";
> }
> }
> else
> {
> //strSort is NOT CurrentSortCol
> currentSortCol = strSort;
> currentSortDirection = currentSortDirection;
> }
>
> //Process Params
>
> // Pass the values to the XSL
> if (frmMain.filter1txt.value != "All")
> {
> if (frmMain.seFilter1.value !="")
> {
> var text1 = frmMain.filter1txt.value;
> var sel1 = frmMain.seFilter1.value;
> objXSLProcessor.addParameter("filter1", text1);
> objXSLProcessor.addParameter("field1", sel1)
> }
> }
>
> if (frmMain.filter2txt.value != "All")
> {
> if (frmMain.seFilter2.value !="")
> {
> var text2 = frmMain.filter2txt.value;
> var sel2 = frmMain.seFilter2.value;
> objXSLProcessor.addParameter("filter2", text2);
> objXSLProcessor.addParameter("field2", sel2)
> }
> }
> objXSLProcessor.addParameter("sortBy",strSort);
> objXSLProcessor.addParameter("direction",currentSortDirection);
> objXSLProcessor.transform();
> Results.innerHTML = objXSLProcessor.output;
> }
>
> function toggleDirection(strSort)
> {
> if (strSort == currentSortCol)
> {
> //alert("strSort is CurrentSortCol");
> if (currentSortDirection =="descending")
> {
> currentSortDirection = "ascending";
> }
> else
> {
> currentSortDirection = "descending";
> }
> }
> else
> {
> //alert("strSort is NOT CurrentSortCol");
> currentSortCol = strSort;
> currentSortDirection = currentSortDirection;
> }
> }
>
> window.onload=DoInit;
> </script>
> </head>
> <body marginheight="0" leftmargin="0" marginwidth="0" topmargin="0" >
> <form name="frmMain">
> <table align="center" id="Table1" width="600px"">
> <tr>
> <td align="left" colspan="2">Filter de data op (case-sensitive,
> beginletter(s) of hele woord):
> <table>
> <tr><td>Kolom 1:</td><td>
> <SELECT NAME="seFilter1">
> <OPTION VALUE=""></OPTION>
> <OPTION VALUE="fclient">client</OPTION>
> <OPTION VALUE="fid">sleutelveld</OPTION>
> <OPTION VALUE="fusername">username</OPTION>
> <OPTION VALUE="fname">naam</OPTION>
> <OPTION VALUE="fcity">woonplaats</OPTION>
> <OPTION VALUE="fdebno">debiteurnr</OPTION>
> </SELECT>
> </td><td>Waarde is:</td><td>
> <input type="text" name="filter1txt" value="All"><br>
> </td></tr><tr><td>Kolom 2:</td><td>
> <SELECT NAME="seFilter2">
> <OPTION VALUE=""></OPTION>
> <OPTION VALUE="fclient">client</OPTION>
> <OPTION VALUE="fid">sleutelveld</OPTION>
> <OPTION VALUE="fusername">username</OPTION>
> <OPTION VALUE="fname">naam</OPTION>
> <OPTION VALUE="fcity">woonplaats</OPTION>
> <OPTION VALUE="fdebno">debiteurnr</OPTION>
> </SELECT>
> </td><td>Waarde is NIET:</td><td>
> <input type="text" name="filter2txt" value="All"><br>
> </td></tr></table>
> <input type="button" name="Filter" value="Filter" onclick="var sTemp =
> currentSortCol;currentSortCol='';renderData(sTemp)">
> <input type="button" name="Reset" value="Reset"
> onclick="frmMain.filter1txt.value='All';frmMain.filter2txt.value='All';f
> rmMain.seFilter1.value='';frmMain.seFilter2.value=''; var sTemp =
> currentSortCol;currentSortCol='';renderData(sTemp)">
> </td></tr><tr><td colspan="2" id="Results"></td>
> </tr><tr><td colspan="2"></td></tr></table></form>
> </body></html>
>
> So I want the second selectbox and textbox to be a negative filter. The
> negative filtering works, but the starts-with() function does not. I
> want to be able to fill in only part of the filtervalue, so for example
> when I select 'woonplaats' and fill in 'G' in the textbox, I get the two
> records with woonplaats "Groningen" and the one with woonplaats "Goor".
> This works for the first filter, but not for the negative one. Hope you
> can help me, thanks in advance! Sharon
>
> *** Sent via Devdex http://www.devdex.com ***
> Don't just participate in USENET...get rewarded for it!
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
