diff --git a/sax.js b/sax.js index 0b3e588..8916dd9 100644 --- a/sax.js +++ b/sax.js @@ -278,6 +278,7 @@ function appendElement(contentHandler,elStack,el,tagName,selfClosed){ } var i = el.length; while(i--){ + a = el[i]; var prefix = a.prefix; if(prefix){//no prefix attribute has no namespace if(prefix === 'xml'){ diff --git a/test/dom/attr.js b/test/dom/attr.js index 065fcf8..41528ea 100644 --- a/test/dom/attr.js +++ b/test/dom/attr.js @@ -31,6 +31,10 @@ wows.describe('XML attrs').addBatch({ // root.firstChild.setAttributeNode(root.attributes[0]); // console.assert(root.attributes.length == 0); }, + "attribute namespace":function(){ + var root = new DOMParser().parseFromString("",'text/xml').documentElement; + console.assert(root.getAttributeNS("a", "b"), "e"); + }, "override ns attribute":function(){ },