DOM processing newbie question

S

Sharon

Hi!
I have this table, which is to be filtered when the user selects a
filteroption from a customized context menu (please don't start with
the context-menu discussion again...this thing I'm working on is
supposed to bear as much resemblance to the software package it is
part of as possible, that's the reason for the customized context
menu). I want to activate different XSL-sheets, depending on the
selection made in the context menu, for example when the user selects
"Filter on NOT somevalue" in the context menu an XSL with a negative
filter is activated. There's also an XSL with a positive filter, a
&lt& filter and a &gt& filter that can be activated. The thing is,
there's already a function that handles the sorting, which looks like
this:

function columnClick()
{
try
{
var DOMDocument=new
ActiveXObject('MSXML2.FreeThreadedDOMDocument');
var XMLDocument=document.XMLDocument;
if (XMLDocument==null)
{
XMLDocument=navigator.XMLDocument;
DOMDocument.loadXML(navigator.XSLDocument.xml);
} else DOMDocument.loadXML(document.XSLDocument.xml);
with (new ActiveXObject('MSXML2.XSLTemplate'))
{
stylesheet=DOMDocument;
with (createProcessor())
{
addParameter('sortfield',event.srcElement.href);
if (event.srcElement.className=='ascending')
{addParameter('sortorder','descending')};
if (!!selectedItem)
{addParameter('selectedid',selectedItem.id)};
input=XMLDocument;
transform();
with (document.open('text/html'))
{
write(output);
navigator.XMLDocument=XMLDocument;
navigator.XSLDocument=DOMDocument;
close();
}
}
}
}
catch(exception)
{
}
Now this DOM-thing is really new to me, I know I have to build a
function similar to this one (or maybe I can even incorporate the
filtering piece in this function?) but there are some things about
this function that puzzle me. For example: where is the XSL loaded? I
will want to specify a certain XSLsheet that I want to use, say
"filterpos.xsl", but it's not really clear to me how and where I
should do that. Can anyone tell me how to go about this? Hope someone
can help, thanks! Sharon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top