CBiX/svgToPdf.js — pull request #6 by bgribaudo (2014-03-19 19:36:31+00:00)
Title: Bug fix for remove attribute functionality

Without this patch, if SVG containing attributes not in `pdfSvgAttr` is rendered with option *removeInvalid* set to true, an `Unable to get property 'name' of undefined or null reference` error may be encountered.

This patch fixes this issue.

## Cause
Code such as the following which deletes items from the attribute collection **while iterating through that same collection:**
````
$.each(node.attributes, function(i, a) {
if(typeof(a) != 'undefined' && pdfSvgAttr.g.indexOf(a.name.toLowerCase()) == -1) {
node.removeAttribute(a.name);
}
});
````

## Example
In the below code, rendering any immediate child of `