Comparing version 0.1.15 to 0.1.16
{ | ||
"name": "xmldom", | ||
"version": "0.1.15", | ||
"version": "0.1.16", | ||
"description": "A W3C Standard XML DOM(Level2 CORE) implementation and parser(DOMParser/XMLSerializer).", | ||
@@ -10,6 +10,6 @@ "keywords": ["w3c","dom","xml","parser","javascript","DOMParser","XMLSerializer"], | ||
"main": "./dom-parser.js", | ||
"scripts": {"test": "./test"}, | ||
"scripts" : { "test": "proof platform win32 && proof test */*/*.t.js || t/test" }, | ||
"engines": {"node": ">=0.1"}, | ||
"dependencies": {}, | ||
"devDependencies": {}, | ||
"devDependencies": { "proof": "0.0.28" }, | ||
"maintainers": [{"name": "jindw","email": "jindw@xidea.org","url": "http://www.xidea.org"}], | ||
@@ -16,0 +16,0 @@ "contributors": [ |
@@ -1,7 +0,7 @@ | ||
Introduction | ||
------- | ||
Another xml parser for nodejs/browser/rhino for java. | ||
Fully compatible with `W3C DOM level2`; and some compatible with `level3`. | ||
support `DOMParser` and `XMLSerializer` interface such as in browser. | ||
# XMLDOM [![Build Status](https://secure.travis-ci.org/bigeasy/xmldom.png?branch=master)](http://travis-ci.org/bigeasy/xmldom) [![Coverage Status](https://coveralls.io/repos/bigeasy/xmldom/badge.png?branch=master)](https://coveralls.io/r/bigeasy/xmldom) [![NPM version](https://badge.fury.io/js/xmldom.png)](http://badge.fury.io/js/xmldom) | ||
A JavaScript implementation of W3C DOM for Node.js, Rhino and the browser. Fully | ||
compatible with `W3C DOM level2`; and some compatible with `level3`. Supports | ||
`DOMParser` and `XMLSerializer` interface such as in browser. | ||
Install: | ||
@@ -8,0 +8,0 @@ ------- |
15
sax.js
@@ -35,2 +35,15 @@ //[4] NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] | ||
function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){ | ||
function fixedFromCharCode(code) { | ||
// String.prototype.fromCharCode does not supports | ||
// > 2 bytes unicode chars directly | ||
if (code > 0xffff) { | ||
code -= 0x10000; | ||
var surrogate1 = 0xd800 + (code >> 10) | ||
, surrogate2 = 0xdc00 + (code & 0x3ff); | ||
return String.fromCharCode(surrogate1, surrogate2); | ||
} else { | ||
return String.fromCharCode(code); | ||
} | ||
} | ||
function entityReplacer(a){ | ||
@@ -41,3 +54,3 @@ var k = a.slice(1,-1); | ||
}else if(k.charAt(0) === '#'){ | ||
return String.fromCharCode(parseInt(k.substr(1).replace('x','0x'))) | ||
return fixedFromCharCode(parseInt(k.substr(1).replace('x','0x'))) | ||
}else{ | ||
@@ -44,0 +57,0 @@ errorHandler.error('entity not found:'+a); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1310427
35
2703
1