DOM processing newbie question

Discussion in 'XML' started by Sharon, Jun 16, 2004.

  1. Sharon

    Sharon Guest

    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
     
    Sharon, Jun 16, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thorsten Meininger
    Replies:
    0
    Views:
    444
    Thorsten Meininger
    Jul 28, 2004
  2. Andrew Neiderer

    using DOM for XML processing

    Andrew Neiderer, Sep 27, 2005, in forum: Java
    Replies:
    3
    Views:
    352
    Andrew Thompson
    Sep 27, 2005
  3. Replies:
    1
    Views:
    373
    [Si]dragon
    Apr 11, 2006
  4. Dr. Laurence Leff
    Replies:
    4
    Views:
    5,750
    Stanimir Stamenkov
    Dec 29, 2004
  5. Hubert Hung-Hsien Chang
    Replies:
    2
    Views:
    516
    Michael Foord
    Sep 17, 2004
Loading...

Share This Page