(strict, opt)
| 25969 | ] |
| 25970 | |
| 25971 | function SAXParser (strict, opt) { |
| 25972 | if (!(this instanceof SAXParser)) { |
| 25973 | return new SAXParser(strict, opt) |
| 25974 | } |
| 25975 | |
| 25976 | var parser = this |
| 25977 | clearBuffers(parser) |
| 25978 | parser.q = parser.c = '' |
| 25979 | parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH |
| 25980 | parser.opt = opt || {} |
| 25981 | parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags |
| 25982 | parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase' |
| 25983 | parser.tags = [] |
| 25984 | parser.closed = parser.closedRoot = parser.sawRoot = false |
| 25985 | parser.tag = parser.error = null |
| 25986 | parser.strict = !!strict |
| 25987 | parser.noscript = !!(strict || parser.opt.noscript) |
| 25988 | parser.state = S.BEGIN |
| 25989 | parser.strictEntities = parser.opt.strictEntities |
| 25990 | parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES) |
| 25991 | parser.attribList = [] |
| 25992 | |
| 25993 | // namespaces form a prototype chain. |
| 25994 | // it always points at the current tag, |
| 25995 | // which protos to its parent tag. |
| 25996 | if (parser.opt.xmlns) { |
| 25997 | parser.ns = Object.create(rootNS) |
| 25998 | } |
| 25999 | |
| 26000 | // mostly just for error reporting |
| 26001 | parser.trackPosition = parser.opt.position !== false |
| 26002 | if (parser.trackPosition) { |
| 26003 | parser.position = parser.line = parser.column = 0 |
| 26004 | } |
| 26005 | emit(parser, 'onready') |
| 26006 | } |
| 26007 | |
| 26008 | if (!Object.create) { |
| 26009 | Object.create = function (o) { |
nothing calls this directly
no test coverage detected