jacomyal/sigma.js — pull request #90 by mattcg (2013-04-08 04:12:38+00:00)
Title: Support viz:* in GEXF in IE

As mentioned in #16, #59, #45 and #73 IE doesn't support `getElementsByTagNameNS`, which makes it impossible to get the `viz` namespaced attributes like `viz:color`, `viz:position` and `viz:size` *the right way*.

**However**, it is still possible to retrieve namespaced nodes using `getElementsByTagName` by passing the full node name, including the namespace, as an argument.

This pull request adds the following shim to the parseGexf plugin:

```javascript
var getElementsByTagNameNS = function(node, ns, tagName) {
if (node.getElementsByTagNameNS) {
return node.getElementsByTagNameNS(ns, tagName);
}

return node.getElementsByTagName(ns + ':' + tagName);
};
```

It's then called like this, for example:

```javascript
positionNodes = positionNodes.length ?
positionNodes :
getElementsByTagNameNS(nodeNode, 'viz','position');
```

Tested in IE9, Chrome, Firefox and Safari.