I'm trying to get an array of attributes and I'm splitting on the whitespace character. What I have works fine except when namespaces are involved. Here is my sample code:
<?xml version="1.0" encoding="utf-8"?> <s:node something xmlns:s = "library://ns.adobe.com/flex/spark" xmlns:b='testnamespace.com' xmlns="noprefix.com"></something>
var attributes:Array = tag.split(/\s+/g);
That results in this array of items:
- something - xmlns:s - = - "library://ns.adobe.com/flex/spark" - xmlns:b='testnamespace.com' - xmlns="noprefix.com"
How would I split the attributes up when there are spaces between the name and value?