diff --git a/lib/sax/SAXParser.js b/lib/sax/SAXParser.js index 2bf9ecbf..68cf37df 100644 --- a/lib/sax/SAXParser.js +++ b/lib/sax/SAXParser.js @@ -4,6 +4,7 @@ var TreeParser = require('./TreeParser').TreeParser; function SAXParser() { this.contentHandler = null; + this.lexicalHandler = null; this._errorHandler = null; this._treeBuilder = new SAXTreeBuilder(); this._tokenizer = new Tokenizer(this._treeBuilder); @@ -14,7 +15,7 @@ SAXParser.prototype.parse = function(source) { this._tokenizer.tokenize(source); var document = this._treeBuilder.document; if (document) { - new TreeParser(this.contentHandler).parse(document); + new TreeParser(this.contentHandler, this.lexicalHandler).parse(document); } }; @@ -23,7 +24,7 @@ SAXParser.prototype.parseFragment = function(source, context) { this._tokenizer.tokenize(source); var fragment = this._treeBuilder.getFragment(); if (fragment) { - new TreeParser(this.contentHandler).parse(fragment); + new TreeParser(this.contentHandler, this.lexicalHandler).parse(fragment); } }; diff --git a/lib/sax/SAXTreeBuilder.js b/lib/sax/SAXTreeBuilder.js index 3a1de57a..4412674a 100644 --- a/lib/sax/SAXTreeBuilder.js +++ b/lib/sax/SAXTreeBuilder.js @@ -672,8 +672,8 @@ ProcessingInstruction.prototype.getNodeType = function() { * @param publicIdentifier the public id * @param systemIdentifier the system id */ -function DTD(name, publicIdentifier, systemIdentifier) { - ParentNode.call(this); +function DTD(locator, name, publicIdentifier, systemIdentifier) { + ParentNode.call(this, locator); this.name = name; this.publicIdentifier = publicIdentifier; this.systemIdentifier = systemIdentifier;