title: How to parse XML including non-html tags with Jquery in IE8
body: <pre><code>&lt;script type="text/javascript"&gt;
  
  var data='&lt;newtag&gt;&lt;othertag attr1="abc" /&gt;&lt;/newtag&gt;';
  var foo = $(data).children('othertag');
  var result = foo.attr('attr1');
  
  alert(result);
  
  &lt;/script&gt;
  </code></pre>
  
  <p>On Mozilla firefox, this code doesn't cause any problems, but on Internet Explorer "newtag" and "othertag" are HTMLUnkownElements, so there's no way to parse them correctly. It won't go further than "newtag".</p>
  
  <p>I looked it up a bit and tried adding parseXml:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  function parseXml(xml)
  {
      if (jQuery.browser.msie)
      {
          var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
          xmlDoc.loadXML(xml);
          xml = xmlDoc;
      }
      return xml;
  }
  
  var data= parseXml('&lt;newtag&gt;&lt;othertag attr1="abc" /&gt;&lt;/newtag&gt;');
  var foo = $(data).children('othertag');
  var result = foo.attr('attr1');
  
  alert(result);
  
  &lt;/script&gt;
  </code></pre>
  
  <p>But no luck. With Mozilla i get "abc" in the alert, with IE I get "undefined".</p>
  
  <p>Any way to solve this in IE, or do I have to use something else than jQuery to parse the xml?</p>
  
  <p>Note that in the real case, there a lot of xml data received from the server and the parsing is a bit more elaborate than that, jQuery is very useful. I'm also using jQuery 1.5 but the 1.6 doesn't make a difference.</p>