SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Dec 2006
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Dispalay xml in mozilla

    I need to feed xml content to a function.

    I did the following code,

    // initialized xmlDoc by identifying browser
    xmlDoc.load("xmlFile.xml");
    alert(xmlDoc.documentElement.xml);

    It works fine in IE but not in mozilla.
    alert(xmlDoc.documentElement) returns an Object Element
    but alert(xmlDoc.documentElement.xml) returns null

    Is there any similar functionalities that work in mozilla.

    Please Help.

  2. #2
    SitePoint Zealot
    Join Date
    Jul 2006
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This article gives some suggestions on loading xml in Mozilla. Mozilla and IE have very different functions for manipulating XML, so you'd have to look up all the individual functions. At the W3C Schools Website they have another example of how to do this in a cross-browser way.

    Dave

  3. #3
    SitePoint Member
    Join Date
    Dec 2006
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Dave

    I got the solution myself from some other site.
    I think this might be useful.

    // initialize xmlDoc by identifying browser
    xmlDoc.load("xmlFile.xml");
    var s = new XMLSerializer();
    var str = s.serializeToString(xmlDoc);
    alert(str);


    Nipun


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •