Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-xml

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-xml - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

90

lib/node-xml.js

@@ -237,22 +237,32 @@ // node-xml

function _indexOf(needle, haystack, start) {
// This is an improvement over the native indexOf because it stops at the
// end of the needle and doesn't continue to the end of the haystack looking.
for(var i = 0; i < needle.length; i++) {
if(needle.charAt(i) != haystack.charAt(start + i))
return -1;
}
return start;
}
var fc = this.m_xml.charAt(this.m_iP);
if (fc !== '<' && fc !== '&') {
return this._parseText (this.m_iP);
}
else if(this.m_iP == this.m_xml.indexOf("<?", this.m_iP)) {
return this._parseText (this.m_iP);
}
else if(this.m_iP == _indexOf("<?", this.m_xml, this.m_iP)) {
return this._parsePI (this.m_iP + 2);
}
else if(this.m_iP == this.m_xml.indexOf("<!DOCTYPE", this.m_iP)) {
else if(this.m_iP == _indexOf("<!DOCTYPE", this.m_xml, this.m_iP)) {
return this._parseDTD (this.m_iP + 9);
}
else if(this.m_iP == this.m_xml.indexOf("<!--", this.m_iP)) {
else if(this.m_iP == _indexOf("<!--", this.m_xml, this.m_iP)) {
return this._parseComment(this.m_iP + 4);
}
else if(this.m_iP == this.m_xml.indexOf("<![CDATA[", this.m_iP)) {
else if(this.m_iP == _indexOf("<![CDATA[", this.m_xml, this.m_iP)) {
return this._parseCDATA (this.m_iP + 9);
}
else if(this.m_iP == this.m_xml.indexOf("<", this.m_iP)) {
else if(this.m_iP == _indexOf("<", this.m_xml, this.m_iP)) {
return this._parseElement(this.m_iP + 1);
}
else if(this.m_iP == this.m_xml.indexOf("&", this.m_iP)) {
else if(this.m_iP == _indexOf("&", this.m_xml, this.m_iP)) {
return this._parseEntity (this.m_iP + 1);

@@ -263,4 +273,2 @@ }

}
}

@@ -804,33 +812,29 @@

var that = this;
var startnew = true;
if(!that.m_parser){
that.m_parser = new XMLP(strD);
startnew = false;
}
else{
that.m_parser.continueParsing(strD);
startnew = true;
}
setTimeout(function(){
var startnew = true;
if(!that.m_parser){
that.m_parser = new XMLP(strD);
startnew = false;
}
else{
that.m_parser.continueParsing(strD);
startnew = true;
}
//if(that.m_hndDoc && that.m_hndDoc.setDocumentLocator) {
// that.m_hndDoc.setDocumentLocator(that);
//}
//if(that.m_hndDoc && that.m_hndDoc.setDocumentLocator) {
// that.m_hndDoc.setDocumentLocator(that);
//}
that.m_bErr = false;
that.m_bErr = false;
if(!that.m_bErr && !startnew) {
that._fireEvent(SaxParser.DOC_B);
}
that._parseLoop();
if(!that.m_bErr && !that.m_interrupted) {
that._fireEvent(SaxParser.DOC_E);
}
if(!that.m_bErr && !startnew) {
that._fireEvent(SaxParser.DOC_B);
}
that._parseLoop();
if(!that.m_bErr && !that.m_interrupted) {
that._fireEvent(SaxParser.DOC_E);
}
that.m_xml = null;
that.m_iP = 0;
that.m_interrupted = false;
}, 0);
that.m_xml = null;
that.m_iP = 0;
that.m_interrupted = false;
}

@@ -845,2 +849,4 @@

this.m_parser.resume();
this.m_interrupted = false;
//now start up the parse loop

@@ -850,2 +856,5 @@ var that = this;

that._parseLoop();
if(!that.m_bErr && !that.m_interrupted) {
that._fireEvent(SaxParser.DOC_E);
}
}, 0);

@@ -966,2 +975,5 @@ }

}
else if (6 == iLen) {
hnd[func](args[1], args[2], args[3], args[4], args[5], args[6]);
}
}

@@ -1000,6 +1012,6 @@

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], };}) );

@@ -1006,0 +1018,0 @@ //this._fireEvent(SaxParser.ELM_E, parser.getName());

{
"name": "node-xml",
"version": "1.0.1",
"version": "1.0.2",
"directories": {

@@ -5,0 +5,0 @@ "lib": "./lib"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc