Loading an XML file from extension - Mozilla

This is a discussion on Loading an XML file from extension - Mozilla ; Hi, I am trying to load an XML file from my extension. The code snippet I use to do this is: var xmlDoc = document.implementation.createDocument("", "", null); xmlDoc.load("/tmp/labels.xml"); xmlDoc.onload = this.loadLabels; This is giving me an error in the error ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Loading an XML file from extension

  1. Loading an XML file from extension

    Hi,

    I am trying to load an XML file from my extension. The code snippet I use to
    do this is:

    var xmlDoc = document.implementation.createDocument("", "", null);
    xmlDoc.load("/tmp/labels.xml");
    xmlDoc.onload = this.loadLabels;

    This is giving me an error in the error console:

    *Error: no element found
    Source file: jar:file:///Applications**/Firefox.app/Contents/MacOS**
    /chrome/browser.jar!/content**/browser/labels**.xml*

    Please let me know if I am doing something wrong. Any help is appreciated.

    Regards,
    - Reema

  2. Re: Loading an XML file from extension

    Reema wrote:
    > Hi,
    >
    > I am trying to load an XML file from my extension. The code snippet I use to
    > do this is:
    >
    > var xmlDoc = document.implementation.createDocument("", "", null);
    > xmlDoc.load("/tmp/labels.xml");
    > xmlDoc.onload = this.loadLabels;
    >
    > This is giving me an error in the error console:
    >
    > *Error: no element found
    > Source file: jar:file:///Applications**/Firefox.app/Contents/MacOS**
    > /chrome/browser.jar!/content**/browser/labels**.xml*
    >
    > Please let me know if I am doing something wrong. Any help is appreciated.
    >
    > Regards,
    > - Reema


    It would probably work if you provided a full url to the xml rather than
    something absolute to the host.

+ Reply to Thread