Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > DOM processing newbie question

Reply
Thread Tools

DOM processing newbie question

 
 
Sharon
Guest
Posts: n/a
 
      06-16-2004
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert a XML DOM Object to a HTML DOM Object manjunath.d@gmail.com XML 0 09-20-2005 08:16 AM
What is the difference between DOM Level 1 and DOM Level 2. mike XML 1 11-20-2004 03:19 PM
Question: processing HTML, re-write default processing action of many tags Hubert Hung-Hsien Chang Python 2 09-17-2004 03:10 PM
Difference between pure DOM and JAXP over DOM ?? Thorsten Meininger XML 0 07-28-2004 08:51 AM
Difference between pure DOM and JAXP over DOM ?? Thorsten Meininger Java 0 07-28-2004 08:51 AM



Advertisments