Problems with XSL/XML Transform Object in Firefox

Discussion in 'Javascript' started by N. Demos, May 13, 2005.

  1. N. Demos

    N. Demos Guest

    I'm having problems with a custom JS object (XMLLoadObject) I designed
    to load XML and XSL files, perform an XSL transform with them and embed
    the resultant HTML fragment into the host HTML document. I designed this
    object so that I could generate and embed HTML fragments from more than
    one XML/XSL source into a single HTML document. This is done by
    instantiating an XMLLoadObject with an XML filename, an XSL filename,
    and the ID of the HTML element as arguments. Once the object is created,
    XSL Parameters can be assigned to the transformation with a member
    function. Finally the documents are loaded and transformed with call to
    the member function xmlLoad(). A distinct object must be instantiated
    for each transform. The object assigns closured member functions as
    event handlers to give access to the object's XML Document and XSL
    Document objects (member data).

    In the specific HTML page in which I'm having the problem
    (schedule.html), two distinct XML sources are loaded and transformed
    with two respective and distinct XSL stylesheets. One generates a simple
    menu of links. The second generates a list of class dates and times
    sorted by date and course number.

    When testing locally, the code worked great in MSIE. Both HTML fragments
    (menu and course list) were loaded, transformed and embeded correctly in
    the page. However, in Firefox (1.0.4) and Netscape (7.2) they did not
    render correctly. In these browsers, the menu was not displayed, while
    the course list was displayed twice (once incorrectly and below that
    correctly). The incorrect display looked like a concantination of all
    the text nodes in the Courses XML file. I believe the problem is in the
    custom javascript load object or my usage Mozilla's implementation of
    XML/XSL transformations, because if I comment out the Load Object code
    of one, the remaining HTML fragment renders correctly.

    When I tested remotely nothing rendered correctly in Firefox or
    Netscape, even if one load object was commented out. The URL to an index
    page of all the files is below. If anyone could take a look at this and
    give me some hints, or ideas as to what's going wrong, I'd appreciate it.

    Thanks and Regards,
    N. Demos



    Index of all files here: http://ndemos.home.att.net/

    Notes: To view it all in action open 'schedule.html'.
    The code for 'XMLLoadObject' (the XML Load Object) is located in
    XMLLoad.js.



    --
    Change "seven" to a digit to email me.
     
    N. Demos, May 13, 2005
    #1
    1. Advertising

  2. N. Demos

    N. Demos Guest

    Nevermind, I figured out the problem. I didn't use the new operator when
    instantiating the XMLLoadObjects.

    N.Demos

    N. Demos wrote:
    > I'm having problems with a custom JS object (XMLLoadObject) I designed
    > to load XML and XSL files, perform an XSL transform with them and embed
    > the resultant HTML fragment into the host HTML document. I designed this
    > object so that I could generate and embed HTML fragments from more than
    > one XML/XSL source into a single HTML document. This is done by
    > instantiating an XMLLoadObject with an XML filename, an XSL filename,
    > and the ID of the HTML element as arguments. Once the object is created,
    > XSL Parameters can be assigned to the transformation with a member
    > function. Finally the documents are loaded and transformed with call to
    > the member function xmlLoad(). A distinct object must be instantiated
    > for each transform. The object assigns closured member functions as
    > event handlers to give access to the object's XML Document and XSL
    > Document objects (member data).
    >
    > In the specific HTML page in which I'm having the problem
    > (schedule.html), two distinct XML sources are loaded and transformed
    > with two respective and distinct XSL stylesheets. One generates a simple
    > menu of links. The second generates a list of class dates and times
    > sorted by date and course number.
    >
    > When testing locally, the code worked great in MSIE. Both HTML fragments
    > (menu and course list) were loaded, transformed and embeded correctly in
    > the page. However, in Firefox (1.0.4) and Netscape (7.2) they did not
    > render correctly. In these browsers, the menu was not displayed, while
    > the course list was displayed twice (once incorrectly and below that
    > correctly). The incorrect display looked like a concantination of all
    > the text nodes in the Courses XML file. I believe the problem is in the
    > custom javascript load object or my usage Mozilla's implementation of
    > XML/XSL transformations, because if I comment out the Load Object code
    > of one, the remaining HTML fragment renders correctly.
    >
    > When I tested remotely nothing rendered correctly in Firefox or
    > Netscape, even if one load object was commented out. The URL to an index
    > page of all the files is below. If anyone could take a look at this and
    > give me some hints, or ideas as to what's going wrong, I'd appreciate it.
    >
    > Thanks and Regards,
    > N. Demos
    >
    >
    >
    > Index of all files here: http://ndemos.home.att.net/
    >
    > Notes: To view it all in action open 'schedule.html'.
    > The code for 'XMLLoadObject' (the XML Load Object) is located in
    > XMLLoad.js.
    >
    >
    >



    --
    Change "seven" to a digit to email me.
     
    N. Demos, May 13, 2005
    #2
    1. Advertising

  3. N. Demos

    N. Demos Guest

    Nevermind, I figured out the problem. I didn't use the new operator when
    instantiating the XMLLoadObjects.

    N.Demos


    --
    Change "seven" to a digit to email me.
     
    N. Demos, May 13, 2005
    #3
    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. KathyB
    Replies:
    0
    Views:
    1,056
    KathyB
    Jun 25, 2003
  2. Matt
    Replies:
    7
    Views:
    19,111
    Andrew Thompson
    May 19, 2004
  3. annoyed tuna
    Replies:
    3
    Views:
    545
    David Carlisle
    Apr 20, 2005
  4. Replies:
    1
    Views:
    5,043
    Martin Honnen
    Oct 26, 2005
  5. Replies:
    3
    Views:
    6,780
    Martin Honnen
    Jun 10, 2006
Loading...

Share This Page