Filter XML Data Island

I am attempting to apply a FILTER to my multi-tier XML Data Island.  THe initial display is ok, but the filter doesn't seem to be working.  I think it is due to the parameters being passed into the doFilter function or the XSLT section when the Filter is selected by the user.  I've searched high and low for such an example and the closest one I can find to modify is by David.  Would be interesting if anyone can assist me in resolving the filtering issue.  Probably only a minor change, but I seems I might have the blinders on.  Thank you.  Jayme


***************Start of HTML file*********************************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><HEAD>
       <title>Links</title>


<!--
AUTHOR: David Silverlight
Editor: This version edited by Jayme Anderson
Email: HeadGeek@xmlpitstop.com
Shameless Plug: Yes I am a consultant who is always looking for cool
projects.
Phone: (877) XML-GURU

Description:  This code snippet demonstrates how to add Filtering to a
DataBound HTML table.
Yes, it  will not work in anything except an IE Browser and No, it does not
do any updates to a database.  That functionality
is outside of the scope of this snippet.

-- Enjoy.
-->

<!--First we want to define the style sheet for this HTML page-->
<STYLE>

INPUT
{
       FONT-SIZE: 9pt;
       HEIGHT:20px;
       COLOR: #330066;
       FONT-FAMILY: Arial, Helvetica, sans-serif;
       BACKGROUND-COLOR: #F0F0F0;
       border : thin outset #F5F5DC;
       border-bottom-color : #F5FFFA;
}

FORM
{
   FONT-SIZE: 10pt;
   COLOR: #330066;
   FONT-FAMILY: Arial, Helvetica, sans-serif
}

TD
{
       FONT-SIZE: 9pt;
        FONT-FAMILY: Arial, Helvetica, sans-serif;
}


BODY
{
   SCROLLBAR-FACE-COLOR: #F0F0F0;
   SCROLLBAR-HIGHLIGHT-COLOR: #CCCCCC;
   SCROLLBAR-SHADOW-COLOR: #CCCCCC;
   SCROLLBAR-3DLIGHT-COLOR: #F0F0F0;
   SCROLLBAR-ARROW-COLOR: #330066;
   SCROLLBAR-DARKSHADOW-COLOR: #CCCCCC;
   SCROLLBAR-BASE-COLOR: #CCCCCC;
}

TR
{
   CURSOR: hand;
       TEXT-ALIGN: left;
       PADDING-LEFT : 4px;
}


.DataTable
{
   BORDER-RIGHT: 0px solid;
   BORDER-TOP: thin solid;
   FONT-WEIGHT: normal;
   FONT-SIZE: 8pt;
   BORDER-LEFT: 0px solid;
   BORDER-BOTTOM: 1px solid;
   FONT-FAMILY: Arial, Helvetica, sans-serif;
   HEIGHT: 1px
}

.MainHeader
{
   FONT-SIZE: 14pt;
   COLOR: Darklue;
   FONT-FAMILY: Arial, Helvetica, sans-serif
}
.DataCol
{
       FONT-SIZE: 8pt;
        FONT-FAMILY: Arial, Helvetica, sans-serif;
}


   </STYLE>

       <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
       <meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5 "></HEAD>

       <body bgcolor="#00FFFF">
               <form method="post" action="" name="frmData">
               <div id="divHeader" style="Z-INDEX: 34; LEFT: 33px; WIDTH:
703px; POSITION: absolute; TOP: 150px; HEIGHT: 149px">

                       <div name="CustomerList" style="LEFT: 1px; OVERFLOW:
scroll; WIDTH: 100%; TOP: 14px; HEIGHT: 350px">


                       <table id="tblHeader" Datasrc="#xmlDSO"
Class="DataTable"  width="100%" cellpadding="0" cellspacing="0" border="1"
style="LEFT: -1px; TOP: 0px">
                               <thead>
                                       <tr>
                                               <th id="thdr"
width="10">#</th>
                                               <th id="thdr"
width="80">Site</th>
                                               <th id="thdr"
width="250">Description</th>
                                               <th id="thdr" width="67"
>Categories</th>
                                               <th id="thdr"
width="90">Rating</th>
                                       </tr>
                               </thead>
                               <tbody>
<tr onclick="CurrentRecord()">
                                               <td width="10" align="left"
height="15"><span datafld="ID" class="xDataCol"></span></td>
                                               <td width="80" align="left"
height="15"><a href datafld="SiteURL" target="_blank"><span
datafld="SiteName" class="xDataCol"></span></a></td>
                                               <td width="250" align="left"
height="15"><span datafld="SiteDescription" class="xDataCol"></span></td>
                                               <td width="67" align="left"
height="15"><table Datasrc="#xmlDSO" datafld="Categories" cellspacing="0" cellpadding="0">
                   <tr><td><span datafld="$text"></span></td></tr>

</table>

</td>
                                               <td width="90" align="left"
height="15"><span datafld="SiteRating" class="xDataCol"></span></td>
                                       </tr>

                       </tbody>
               </table>
       </div>
</div>


<div id="main" style="LEFT: 0px; WIDTH: 759px; POSITION: absolute; TOP:
100px; HEIGHT: 29px" tabIndex="11">
       <div id="divSearch" style="LEFT: 32px; WIDTH: 710px; POSITION:
absolute; TOP: -100px; HEIGHT: 27px">
               <table  ID="tblSearchFields" border=1 bgcolor="menu"
width="100%">
                       <tr>
                               <td colspan="2"  >Select your site using the
criteria below:</td>
                               <td colspan="2"  ><Input type=button
value="Show all"id=btnShowAll name=btnShowAll onclick="doShowAll()"></td>
                               </tr>
                       <tr>
                               <td>
                                       Category:
                                               <SELECT ID="selCategory"
NAME="selCategory" onchange="doFilter()">
                                                       <OPTION selected
value="Political">Political</OPTION>
                                                       <OPTION
value="Military">Military</OPTION>
                                                       <OPTION
value="Social">Social</OPTION>
                                                       <OPTION
value="Economic">Economic</OPTION>
                                                       <OPTION
value="Information">Information</OPTION>
                                                       <OPTION
value="Infrastructure">Infrastructure</OPTION>
                                               </SELECT>

                               </td>
                               <td>
                                       Rating:
                                               <SELECT ID="selSiteRating"
NAME="selSiteRating" onchange="doFilter()">
                                                       <OPTION selected
value="5">5</OPTION>
                                                       <OPTION
value="4">4</OPTION>
                                                       <OPTION
value="3">3</OPTION>
                                                       <OPTION
value="2">2</OPTION>
                                                       <OPTION
value="1">1</OPTION>
                                               </SELECT>
                               </td>
                       </tr>
               </table>

       </div>


               </div>

</form>
<!-- Below are the actual Data Islands that hold the xml file and xsl
Sorting stylesheet.  The names of the data islands are important. -->
<xml id="xslFilter">
<xsl:stylesheet xmlns:xsl=" http://www.w3.org/1999/XSL/Transform "
version="1.0"><xsl:output method="xml"/>

<xsl:param name="Categories" select="'Political'"/>
<xsl:param name="SiteRating" select="'5'"/>

<xsl:template match="/">

       <CATALOG>
       <xsl:for-each select="CATALOG/SITE[@Categories=$Categories and
@SiteRating=$SiteRating]" >

       <xsl:sort select="@ID" order="ascending" />

               <data>
                       <xsl:for-each select="@*" >
                               <xsl:attribute name='{name()}'>
<xsl:value-of select="."/></xsl:attribute>
                       </xsl:for-each>
               </data>
       </xsl:for-each>
       </CATALOG>

</xsl:template>



<xsl:template match="data">
       <data>
               <xsl:apply-templates/>
       </data>
</xsl:template>
</xsl:stylesheet>
</xml>

<xml id="xmlDSO">
<CATALOG>
       <SITE ID="01" SiteName="Jowairiyya" SiteDescription="I am winking at
you" SiteRating="5"
SiteURL=" http://library.nps.navy.mil/home/tgp/tgpndx.htm#2001">
<Categories SiteID="01">
   <Category SiteID="01">Political</Category>
   <Category SiteID="01">Social</Category>
   <Category SiteID="01">Economic</Category>
</Categories>
       </SITE>
       <SITE ID="02" SiteName="PapaJohn" SiteDescription="This is a test" SiteRating="4"
SiteURL=" http://library.nps.navy.mil/home/tgp/tgpndx.htm#2001">
<Categories SiteID="02">
   <Category SiteID="02">Political</Category>
   <Category SiteID="02">Military</Category>
   <Category SiteID="02"></Category>
</Categories>
       </SITE>
</CATALOG>
</xml>
<!-- Note: the reason for the xmlDSOorig data island is that the xmlDSO data
island becomes repopulated after
a filtering  is performed.  If you try to filter a second time, you will
need to start from the original contents. -->
<xml id="xmlDSOorig">
<CATALOG>
       <SITE ID="01" SiteName="Jowairiyya" SiteDescription="I am winking at
you" SiteRating="5"
SiteURL=" http://library.nps.navy.mil/home/tgp/tgpndx.htm#2001">
<Categories SiteID="01">
   <Category SiteID="01">Political</Category>
   <Category SiteID="01">Social</Category>
   <Category SiteID="01">Economic</Category>
</Categories>
       </SITE>
       <SITE ID="02" SiteName="PapaJohn" SiteDescription="This is a test" SiteRating="4"
SiteURL=" http://library.nps.navy.mil/home/tgp/tgpndx.htm#2001">
<Categories SiteID="02">
   <Category SiteID="02">Political</Category>
   <Category SiteID="02">Military</Category>
   <Category SiteID="02"></Category>
</Categories>
       </SITE>

</CATALOG>
</xml>


<!-- Last but not least, the javascript code is the only javascript that you
will see in this page.  Look ma, no includes! -->

<script language="JavaScript">

function doShowAll() {
       try {
               xmlDSO.loadXML(xmlDSOorig.xml);
       }
       catch (error) {
               alert("doShowAll() in Default.htm caused the following
error: " + error.SiteDescription)
       }

}


function doFilter() {
       try {
               var strRating = document.all.selSiteRating.value;
               var strCategory = document.all.selCategory.value;
               vbFilterTable(strCategory, strRating);
       }
       catch (error) {
               alert("doFilter() in Default.htm caused the following error:
" + error.SiteDescription)
       }

}

  function CurrentRecord(){
               try {
                       var iNum = window.event.srcElement.recordNumber ;
                       xmlDSO.recordset.AbsolutePosition = iNum;

               }
               catch (error) {
                       alert("CurrentRecord() in Default.htm caused the
following error: " + error.SiteDescription)
       }

}


       </script>
<script language="vbscript">

function vbFilterTable(strCategory, strRating)

               dim objXSL, objXML, objTemplate, objProcessor, strHTML

               Set objXML = CreateObject("Msxml2.FreeThreadedDOMDocument")
               Set objXSL = CreateObject("Msxml2.FreeThreadedDOMDocument")

               'Load the XML document
               objXML.async = False
               objXML.Loadxml xmlDSOorig.xml

               'Load the XSL document
               objXSL.async = False
               objXSL.Loadxml  xslFilter.xml

               'Create an instance of our XSL Template object
               'Set objTemplate = CreateObject("MSXML2.XSLTemplate.3.0")
               Set objTemplate = CreateObject("MSXML2.XSLTemplate ")

               'Create an instance of our stylesheet object using our
recently loaded XSLT document
               Set objTemplate.stylesheet = objXSL

               'Create an instance of our Processor object
               Set objProcessor = objTemplate.createProcessor

               'Define the input object for our object equal to our
recently loaded XML document
               objProcessor.input = objXML

               'Now, finally we can add any parameters that we require to
our Template processor
               objProcessor.AddParameter "Categories", strCategory
               objProcessor.AddParameter "SiteRating", strRating

               'Last but not least we do our transformation
               objProcessor.Transform

               'Store the results of the output into a string.
               strXML = objProcessor.output


               'Load up an XML DOM object from the recent XML output
               objXML.loadxml strXML

               'Select only the "SITE" elements from our document object
               objXML.selectNodes("//CATALOG")

               'Load our Data Island using our new XML object
               xmlDSO.loadxml  objXML.xml



       end function

       </script>


       </body>
</html>

jayme9Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jayme9Author Commented:
Anyone have any examples that demonstrate Filtering a 2-tier XML data island that they would be willing to share?  I've seen examples that use one 1-tier.  I'm just trying to filter on SiteRating and Category tags for this XML below:

<xml id="xmlDSO">
<CATALOG>
<SITE ID="01" SiteName="Terrorist Group Profiles" SiteDescription="Index of Groups" SiteRating="5" SiteURL="http://library.nps.navy.mil/home/tgp/tgpndx.htm#2001">
<Categories SiteID="01">
   <Category SiteID="01">Military</Category>
   <Category SiteID="01">Social</Category>
   <Category SiteID="01"></Category>
</Categories>
</SITE>

<SITE ID="02" SiteName="Global Security" SiteDescription="" SiteRating="4" SiteURL="http://www.globalsecurity.org/military/ops/iraq_insurgency.htm">
<Categories SiteID="02">
   <Category SiteID="02">Political</Category>
   <Category SiteID="02">Social</Category>
   <Category SiteID="02">Economic</Category>
</Categories>
</SITE>

<SITE ID="03" SiteName="SITE Institute / Terrorist Groups" SiteDescription="" SiteRating="4" SiteURL="http://siteinstitute.org/terroristgroups.html">
<Categories>
   <Category>Infrastructure</Category>
   <Category>Social</Category>
   <Category>Information</Category>
</Categories>
</SITE>

</CATALOG>
</xml>

Thank you in advance.

Jayme
0
jayme9Author Commented:
For some other poor unfortunate soul attempting to do this, here is how I got it working:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><HEAD>
      <title>Links</title>


<!--
AUTHOR: Jayme Anderson
Email: andersoj@eucom.mil
      
SiteDescription:  This code snippet demonstrates how to add Filtering to a DataBound HTML table.  
Yes, it  will not work in anything except an IE Browser and No, it does not do any updates to a database.  That functionality
is outside of the scope of this snippet.

-->
<!--First we want to define the style sheet for this HTML page-->
<STYLE>

INPUT
{
      FONT-SIZE: 9pt;
      HEIGHT:20px;
      COLOR: #330066;
      FONT-FAMILY: Arial, Helvetica, sans-serif;
      BACKGROUND-COLOR: #F0F0F0;
      border : thin outset #F5F5DC;
      border-bottom-color : #F5FFFA;
}

FORM
{
    FONT-SIZE: 10pt;
    COLOR: #330066;
    FONT-FAMILY: Arial, Helvetica, sans-serif
}

TD
{
      FONT-SIZE: 9pt;
       FONT-FAMILY: Arial, Helvetica, sans-serif;
}


BODY
{
    SCROLLBAR-FACE-COLOR: #F0F0F0;
    SCROLLBAR-HIGHLIGHT-COLOR: #CCCCCC;
    SCROLLBAR-SHADOW-COLOR: #CCCCCC;
    SCROLLBAR-3DLIGHT-COLOR: #F0F0F0;
    SCROLLBAR-ARROW-COLOR: #330066;
    SCROLLBAR-DARKSHADOW-COLOR: #CCCCCC;
    SCROLLBAR-BASE-COLOR: #CCCCCC;
}

TR
{
    CURSOR: hand;
      TEXT-ALIGN: left;
      PADDING-LEFT : 4px;
}


.DataTable
{
    BORDER-RIGHT: 0px solid;
    BORDER-TOP: thin solid;
    FONT-WEIGHT: normal;
    FONT-SIZE: 8pt;
    BORDER-LEFT: 0px solid;
    BORDER-BOTTOM: 1px solid;
    FONT-FAMILY: Arial, Helvetica, sans-serif;
    HEIGHT: 1px
}

.MainHeader
{
    FONT-SIZE: 14pt;
    COLOR: Darklue;
    FONT-FAMILY: Arial, Helvetica, sans-serif
}
.DataCol
{
      FONT-SIZE: 8pt;
       FONT-FAMILY: Arial, Helvetica, sans-serif;
}


    </STYLE>

      <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
      <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"></HEAD>

      <body bgcolor="#00FFFF"><h2 align="center" style="background-color:White"><b>Site List</b></h2>
            <form method="post" action="" name="frmData">
            <div id="divHeader" style="Z-INDEX: 34; LEFT: 33px; WIDTH: 703px; POSITION: absolute; TOP: 150px; HEIGHT: 149px">

                  <div name="CustomerList" style="LEFT: 1px; OVERFLOW: scroll; WIDTH: 100%; TOP: 14px; HEIGHT: 350px">


                  <table id="tblHeader" Datasrc="#xmlDSO" Class="DataTable"  width="100%" cellpadding="0" cellspacing="0" border="1" style="LEFT: -1px; TOP: 0px">
                        <thead>
                              <tr bgcolor="Yellow">
                                    <th id="thdr" width="10">#</th>
                                    <th id="thdr" width="80">Site</th>
                                    <th id="thdr" width="250">Description</th>
                                    <th id="thdr" width="67" >Categories</th>
                                    <th id="thdr" width="90">Rating</th>                                    
                              </tr>
                        </thead>
                        <tbody>
<tr onclick="CurrentRecord()">
                                    <td width="10" align="left" height="15"><span datafld="ID" class="xDataCol"></span></td>
                                    <td width="80" align="left" height="15"><a href datafld="SiteURL" target="_blank"><span datafld="SiteName" class="xDataCol"></span></a></td>
                                    <td width="250" align="left" height="15"><span datafld="SiteDescription" class="xDataCol"></span></td>
                                    <td width="67" align="left" height="15"><table Datasrc="#xmlDSO" datafld="Category" cellspacing="0" cellpadding="0">
                   <tr><td><span datafld="$text"></span></td></tr>
</table></td>
                                    <td width="90" align="left" height="15"><span datafld="SiteRating" class="xDataCol"></span></td>
                              </tr>

                  </tbody>
            </table>
      </div>
</div>


<div id="main" style="LEFT: 0px; WIDTH: 759px; POSITION: absolute; TOP: 150px; HEIGHT: 29px" tabIndex="11">
      <div id="divSearch" style="LEFT: 32px; WIDTH: 710px; POSITION: absolute; TOP: -100px; HEIGHT: 27px">
            <table  ID="tblSearchFields" border=1 bgcolor="menu" width="100%">
                  <tr>
                        <td colspan="2"  >Select your site using the criteria below:</td>
                        <td colspan="2"  ><Input type=button value="Show all"id=btnShowAll name=btnShowAll onclick="doShowAll()"></td>
                        </tr>
                  <tr>
                        <td>
                              Category:
                                    <SELECT ID="selCategory" NAME="selCategory" onchange="doFilter()">
                                          <OPTION selected value="Political">Political</OPTION>
                                          <OPTION value="Military">Military</OPTION>
                                          <OPTION value="Social">Social</OPTION>
                                          <OPTION value="Economic">Economic</OPTION>
                                          <OPTION value="Information">Information</OPTION>
                                          <OPTION value="Infrastructure">Infrastructure</OPTION>
                                    </SELECT>

                        </td>
                        <td>
                              Rating:
                                    <SELECT ID="selSiteRating" NAME="selSiteRating" onchange="doFilter()">
                                          <OPTION selected value="5">5</OPTION>
                                          <OPTION value="4">4</OPTION>
                                          <OPTION value="3">3</OPTION>
                                          <OPTION value="2">2</OPTION>
                                          <OPTION value="1">1</OPTION>
                                    </SELECT>
                        </td>
                  </tr>
            </table>

      </div>


            </div>
                  
</form>
<!-- Below are the actual Data Islands that hold the xml file and xsl Sorting stylesheet.  The names of the data islands are important. -->

<xml id="xslFilter">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:output method="xml"/>

<xsl:param name="Category" select="'Political'"/>
<xsl:param name="SiteRating" select="'5'"/>

<xsl:template match="/">

      <CATALOG>
      <xsl:for-each select="CATALOG/SITE[Category=$Category and @SiteRating=$SiteRating]" >
      
      <xsl:sort select="@ID" order="ascending" />

            <data>
                    <xsl:for-each select="@*" > 
                        <xsl:attribute name='{name()}'> <xsl:value-of select="."/></xsl:attribute>
                    </xsl:for-each>
                    <xsl:for-each select="Category" > 
                        <xsl:element name='{name()}'><xsl:value-of select="."/></xsl:element>
                    </xsl:for-each>

            </data>
      </xsl:for-each>
      </CATALOG>

</xsl:template>



<xsl:template match="data">
      <data>
            <xsl:apply-templates/>
      </data>
</xsl:template>
</xsl:stylesheet>
</xml>
<xml id="xmlDSO">
<CATALOG>
<SITE ID="01" SiteName="Terrorist Group Profiles" SiteDescription="Index of Groups" SiteRating="5" SiteURL="http://library.nps.navy.mil/home/tgp/tgpndx.htm#2001">
   <Category>Political</Category>
   <Category>Social</Category>
   <Category>Economic</Category>
</SITE>

<SITE ID="02" SiteName="Global Security" SiteDescription="" SiteRating="4" SiteURL="http://www.globalsecurity.org/military/ops/iraq_insurgency.htm">
   <Category>Political</Category>
   <Category>Social</Category>
   <Category>Economic</Category>
</SITE>

<SITE ID="03" SiteName="SITE Institute / Terrorist Groups" SiteDescription="" SiteRating="4" SiteURL="http://siteinstitute.org/terroristgroups.html">
   <Category>Political</Category>
   <Category>Social</Category>
   <Category>Economic</Category>
</SITE>

<SITE ID="04" SiteName="Global Terror Alert" SiteDescription="A private web site purporting to offer terrorism reports" SiteRating="5" SiteURL="http://www.globalterroralert.com">
   <Category>Political</Category>
   <Category >Social</Category>
   <Category>Military</Category>
</SITE>

<SITE ID="05" SiteName="Other Terrorism Links" SiteDescription="" SiteRating="5" SiteURL="http://fpc.state.gov/documents/organization/44914.pdf">
   <Category>Political</Category>
   <Category>Social</Category>
   <Category>Economic</Category>
</SITE>

<SITE ID="06" SiteName="Other Terrorism Links" SiteDescription="" SiteRating="3" SiteURL="http://cns.miis.edu/research/wtc01/alqaida.htm">
   <Category>Political</Category>
   <Category>Social</Category>
   <Category>Economic</Category>
</SITE>

<SITE ID="07" SiteName="Other Terrorism Links" SiteDescription="" SiteRating="4" SiteURL="http://www.satp.org/satporgtp/countries/india/states/jandk/terrorist_outfits/index.html">
   <Category>Political</Category>
   <Category>Social</Category>
   <Category>Economic</Category>
</SITE>
</CATALOG>
</xml>
<!-- Note: the reason for the xmlDSOorig data island is that the xmlDSO data island becomes repopulated after
a filtering  is performed.  If you try to filter a second time, you will need to start from the original contents. -->
<xml id="xmlDSOorig">
<CATALOG>
<SITE ID="01" SiteName="Terrorist Group Profiles" SiteDescription="Index of Groups" SiteRating="5" SiteURL="http://library.nps.navy.mil/home/tgp/tgpndx.htm#2001">
   <Category>Political</Category>
   <Category>Social</Category>
   <Category>Economic</Category>
</SITE>

<SITE ID="02" SiteName="Global Security" SiteDescription="" SiteRating="4" SiteURL="http://www.globalsecurity.org/military/ops/iraq_insurgency.htm">
   <Category>Political</Category>
   <Category>Social</Category>
   <Category>Economic</Category>
</SITE>

<SITE ID="03" SiteName="SITE Institute / Terrorist Groups" SiteDescription="" SiteRating="4" SiteURL="http://siteinstitute.org/terroristgroups.html">
   <Category>Political</Category>
   <Category>Social</Category>
   <Category>Economic</Category>
</SITE>

<SITE ID="04" SiteName="Global Terror Alert" SiteDescription="A private web site purporting to offer terrorism reports" SiteRating="5" SiteURL="http://www.globalterroralert.com">
   <Category>Political</Category>
   <Category >Social</Category>
   <Category>Military</Category>
</SITE>

<SITE ID="05" SiteName="Other Terrorism Links" SiteDescription="" SiteRating="5" SiteURL="http://fpc.state.gov/documents/organization/44914.pdf">
   <Category>Political</Category>
   <Category>Social</Category>
   <Category>Economic</Category>
</SITE>

<SITE ID="06" SiteName="Other Terrorism Links" SiteDescription="" SiteRating="3" SiteURL="http://cns.miis.edu/research/wtc01/alqaida.htm">
   <Category>Political</Category>
   <Category>Social</Category>
   <Category>Economic</Category>
</SITE>

<SITE ID="07" SiteName="Other Terrorism Links" SiteDescription="" SiteRating="4" SiteURL="http://www.satp.org/satporgtp/countries/india/states/jandk/terrorist_outfits/index.html">
   <Category>Political</Category>
   <Category>Social</Category>
   <Category>Economic</Category>
</SITE>
</CATALOG>
</xml>


<!-- Last but not least, the javascript code is the only javascript that you will see in this page.  Look ma, no includes! -->

<script language="JavaScript">

function doShowAll() {
      try {
            document.all.selCategory.value = "Political"; <!-- Reset filter drop down to default value! -->
            document.all.selSiteRating.value = "5";           <!-- Reset filter drop down to default value! -->
            xmlDSO.loadXML(xmlDSOorig.xml);                 <!-- Display the original XML data island! -->
      }
      catch (error) {
            alert("doShowAll() in Default.htm caused the following error: " + error.SiteDescription)
      }

}


function doFilter() {
      try {
            var strCategory = document.all.selCategory.value;  <!-- Set variable to users selection to Category filter! -->            
            var strRating = document.all.selSiteRating.value;     <!-- Set variable to users selection to SiteRating filter! -->
            vbFilterTable(strCategory, strRating);                          <!-- Run variables through vb filter function! -->
      }      
      catch (error) {
            alert("doFilter() in Default.htm caused the following error: " + error.SiteDescription)
      }

}

   function CurrentRecord(){
            try {
                  var iNum = window.event.srcElement.recordNumber;
                  xmlDSO.recordset.AbsolutePosition = iNum;            
            }
            catch (error) {
                  alert("CurrentRecord() in Default.htm caused the following error: " + error.SiteDescription)
      }

}


        </script>


<script language="vbscript">

function vbFilterTable(strCategory, strRating)     <!-- Gets variables from doFilter function! -->
            
            dim objXSL, objXML, objTemplate, objProcessor, strHTML
      
            Set objXML = CreateObject("Msxml2.FreeThreadedDOMDocument")
            Set objXSL = CreateObject("Msxml2.FreeThreadedDOMDocument")

            'Load the XML document
            objXML.async = False
            objXML.Loadxml xmlDSOorig.xml
                         
            'Load the XSL document
            objXSL.async = False
            objXSL.Loadxml  xslFilter.xml
                         
            'Create an instance of our XSL Template object
            'Set objTemplate = CreateObject("MSXML2.XSLTemplate.3.0")
            Set objTemplate = CreateObject("MSXML2.XSLTemplate")
                         
            'Create an instance of our stylesheet object using our recently loaded XSLT document
            Set objTemplate.stylesheet = objXSL
                           
            'Create an instance of our Processor object
            Set objProcessor = objTemplate.createProcessor

            'Define the input object for our object equal to our recently loaded XML document
            objProcessor.input = objXML

            'Now, finally we can add any parameters that we require to our Template processor
            objProcessor.AddParameter "Category", strCategory
            objProcessor.AddParameter "SiteRating", strRating
                         
            'Last but not least we do our transformation
            objProcessor.Transform
                         
            'Store the results of the output into a string.
            strXML = objProcessor.output

            
            'Load up an XML DOM object from the recent XML output
            objXML.loadxml strXML
            
            'Select only the "SITE" elements from our document object
            objXML.selectNodes("//CATALOG")
            
            'Load our Data Island using our new XML object
            xmlDSO.loadxml  objXML.xml

            
            
      end function       
      
        </script>      

      </body>
</html>
0
EE_AutoDeleterCommented:
jayme9,
Because you have presented a solution to your own problem which may be helpful to future searches, this question is now PAQed and your points have been refunded.

EE_AutoDeleter
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.