Skip to content
Browse files

Merge pull request #23 from kruncher/master

Allow detection of empty elements - Issue #22
  • Loading branch information...
2 parents 49bff5d + 5bdc745 commit be66f7da55184200753e9707c55a3b49deb83851 @robrighter committed Sep 13, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/node-xml.js
View
7 lib/node-xml.js
@@ -967,6 +967,9 @@ SaxParser.prototype._fireEvent = function(iEvt) {
else if (5 == iLen) {
hnd[func](args[1], args[2], args[3], args[4], args[5]);
}
+ else if (6 == iLen) {
+ hnd[func](args[1], args[2], args[3], args[4], args[5], args[6]);
+ }
}
}
@@ -1000,10 +1003,10 @@ SaxParser.prototype._parseLoop = function(parser) {
nameobject = parser._parsePrefixAndElementName(parser.getName());
theattsandnamespace = parser._parseNamespacesAndAtts(theatts);
var theuri = parser._getContextualNamespace(nameobject.prefix);
- this._fireEvent(SaxParser.ELM_B, nameobject.name, theattsandnamespace[0], (nameobject.prefix === '')? null : nameobject.prefix, (theuri === '')? null : theuri ,theattsandnamespace[1] );
+ this._fireEvent(SaxParser.ELM_B, nameobject.name, theattsandnamespace[0], (nameobject.prefix === '')? null : nameobject.prefix, (theuri === '')? null : theuri ,theattsandnamespace[1], true );
parser._removeExpiredNamesapces(parser.getName());
- this._fireEvent(SaxParser.ELM_E, nameobject.name, (nameobject.prefix === '')? null : nameobject.prefix, (theuri === '')? null : theuri);
+ this._fireEvent(SaxParser.ELM_E, nameobject.name, (nameobject.prefix === '')? null : nameobject.prefix, (theuri === '')? null : theuri, true);
//this._fireEvent(SaxParser.ELM_B, parser.getName(), this.m_parser.m_atts.map(function(item){return { name : item[0], value : item[1], };}) );
//this._fireEvent(SaxParser.ELM_E, parser.getName());
}

0 comments on commit be66f7d

Please sign in to comment.
Something went wrong with that request. Please try again.