Ok I have the following code which retreives and xml file - the code
then locates each 'description' node and loads the contents into an
array.

It then loops through each 'term' in teh xml file and looks for that
string withint the specified container.

if found the terms is wrapped in a span.

All works fine in FF but IE simply cannot parse the xml properly...

The code...


    $.ajax
    (
      {
        type: "GET",
        url: "http://localhost/jargonterms.xml";,
        dataType: ($.browser.msie) ? "text" : "xml",


        success: function(data)
        {
          var xml;
          if  (
              typeof data == "string"
              )
          {
            xml = new ActiveXObject("Microsoft.XMLDOM");
            xml.async = false;
            xml.loadXML(data);
          }
          else
          {
            xml = data;
          }
          j=0;
          desc = new Array();
          $(xml).find('description').each // IE can't process this!!!!
          (
            function()
            {
              var tmpD = $(this).text();
              desc[j++] = tmpD;
            }
          );

          var cont = $("#iContentHolder").html();

          j=0;
          $(xml).find('term').each
          (
            function()
            {
              term = $(this).text();
              cont = cont.replace(term,'<span class="jargonterm"
id="term-'+j+'">'+term+'</span>');
              j++;
            }
          );
          $("#iContentHolder").html(cont);
        },

        error:  function (XMLHttpRequest, textStatus, errorThrown)
        {
          alert(textStatus);
        }

      }
    ); //close $.ajax(


I don't know why IE can't find the nodes to loop through and create
the desc array and I suspect it can't loop through the term nodes
either.

What am I missing here? I've read enough 'IE XML parsing problem'
items and can't see anything that applies to this situation...

Reply via email to