title: Internet Explorer XML/SVG Custom Namespacing - Extra/Wrong Namespaces Generated
body: <p>I am trying to render an SVG document inside of a webpage, and then capture the markup of that SVG document via JavaScript.  This SVG markup is then sent back to the server for processing.</p>
  
  <p>The root of my SVG document is similar to the following:</p>
  
  <pre><code>&lt;svg id="layout" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:foobar="http://www.foobar.com" foobar:attribute="123abc"&gt;
  </code></pre>
  
  <p>This is working perfectly fine in Webkit and Firefox, but Internet Explorer (as usual) is causing problems.  When the SVG gets rendered in IE, it looks fine, but when I get its markup via JavaScript/jQuery (XMLSerializer), the SVG strings root node now looks like this:</p>
  
  <pre><code>&lt;svg xmlns="http://www.w3.org/2000/svg" id="layout" xmlns:NS1="" NS1:foobar:attribute="123abc" xmlns:NS2="" NS2:xmlns:foobar="http://www.foobar.com"&gt;
  </code></pre>
  
  <p>The SVG gets displayed properly, but, as you can see, the namespacing is messed up (and the attributes have been rearranged, but that's not really a concern) when the XML gets serialized.  These messed up namespaces break the server-side code that processes the submitted SVG strings.  Anyone able to shed some light on what is going on?</p>
  
  <p>I've done an afternoon of Googling, and can't seem to come up with a whole lot.  All of the examples that I've seen are of people trying to add namespaces via JavaScript/jQuery and getting similar results (namespace-wise) to what I'm seeing happen.</p>
  
  <p>In hopes that someone over on MSDN knows what's going on, I've also opened <a href="http://social.msdn.microsoft.com/Forums/ie/en-US/cad30264-e877-4593-8890-4c629bb07f02/using-xmlserializer-on-svgsvgelement-with-custom-namespaces-is-broken?forum=iewebdevelopment" rel="nofollow">a thread there</a>.</p>
  
  <p><em>Edit:  added some details</em></p>
  
  <p><em>Edit 2:  added link to MSDN thread</em></p>