nlptoolkit-xmlparser 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  For Developers
2
2
  ============
3
- You can also see [C++](https://github.com/starlangsoftware/Util-CPP) repository.
3
+ You can also see [C++](https://github.com/starlangsoftware/XmlParser-CPP), [C](https://github.com/starlangsoftware/XmlParser-C), [Php](https://github.com/starlangsoftware/XmlParser-Php), or [Java](https://github.com/starlangsoftware/XmlParser) repository.
4
4
 
5
5
  ## Requirements
6
6
 
@@ -1,10 +1,9 @@
1
1
  export declare class XmlAttribute {
2
- private name;
2
+ private readonly name;
3
3
  private value;
4
4
  /**
5
5
  * Constructor for xml attribute. Initializes the attribute.
6
6
  * @param name Name of the attribute
7
- * @return Allocated and initialized attribute
8
7
  */
9
8
  constructor(name: string);
10
9
  getName(): string;
@@ -14,7 +14,6 @@
14
14
  /**
15
15
  * Constructor for xml attribute. Initializes the attribute.
16
16
  * @param name Name of the attribute
17
- * @return Allocated and initialized attribute
18
17
  */
19
18
  function XmlAttribute(name) {
20
19
  this.name = name;
@@ -1 +1 @@
1
- {"version":3,"file":"XmlAttribute.js","sourceRoot":"","sources":["../source/XmlAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA;QAKI;;;;WAIG;QACH,sBAAY,IAAY;YACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QACpB,CAAC;QAED,8BAAO,GAAP;YACI,OAAO,IAAI,CAAC,IAAI,CAAA;QACpB,CAAC;QAED,+BAAQ,GAAR;YACI,OAAO,IAAI,CAAC,KAAK,CAAA;QACrB,CAAC;QAED,+BAAQ,GAAR,UAAS,KAAa;YAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QACtB,CAAC;QAED,+BAAQ,GAAR;YACI,OAAO,IAAI,CAAC,IAAI,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QACjD,CAAC;QACL,mBAAC;IAAD,CAAC,AA7BD,IA6BC;IA7BY,oCAAY"}
1
+ {"version":3,"file":"XmlAttribute.js","sourceRoot":"","sources":["../source/XmlAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA;QAKI;;;WAGG;QACH,sBAAY,IAAY;YACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QACpB,CAAC;QAED,8BAAO,GAAP;YACI,OAAO,IAAI,CAAC,IAAI,CAAA;QACpB,CAAC;QAED,+BAAQ,GAAR;YACI,OAAO,IAAI,CAAC,KAAK,CAAA;QACrB,CAAC;QAED,+BAAQ,GAAR,UAAS,KAAa;YAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QACtB,CAAC;QAED,+BAAQ,GAAR;YACI,OAAO,IAAI,CAAC,IAAI,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QACjD,CAAC;QACL,mBAAC;IAAD,CAAC,AA5BD,IA4BC;IA5BY,oCAAY"}
@@ -10,7 +10,6 @@ export declare class XmlElement {
10
10
  * Constructor for xml element. Allocates memory and initializes an element.
11
11
  * @param name Name of the element
12
12
  * @param parent Parent of the Xml Element
13
- * @return Constructed element
14
13
  */
15
14
  constructor(name: string, parent: XmlElement);
16
15
  getName(): string;
@@ -15,7 +15,6 @@
15
15
  * Constructor for xml element. Allocates memory and initializes an element.
16
16
  * @param name Name of the element
17
17
  * @param parent Parent of the Xml Element
18
- * @return Constructed element
19
18
  */
20
19
  function XmlElement(name, parent) {
21
20
  this.name = "";
@@ -1 +1 @@
1
- {"version":3,"file":"XmlElement.js","sourceRoot":"","sources":["../source/XmlElement.ts"],"names":[],"mappings":";;;;;;;;;;;;IAEA;QASI;;;;;WAKG;QACH,oBAAY,IAAY,EAAE,MAAkB;YAb3B,SAAI,GAAW,EAAE,CAAA;YAC1B,WAAM,GAAW,EAAE,CAAA;YAavB,IAAI,CAAC,IAAI,GAAG,IAAI,CA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,CAAC;QAED,8BAAS,GAAT,UAAU,MAAc;YACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACxB,CAAC;QAED,kCAAa,GAAb;YACI,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,CAAA;QACtC,CAAC;QAEL,iBAAC;IAAD,CAAC,AA/FD,IA+FC;IA/FY,gCAAU"}
@@ -0,0 +1,5 @@
1
+ export * from "./XmlDocument";
2
+ export * from "./XmlElement";
3
+ export * from "./XmlAttribute";
4
+ export * from "./XmlTokenType";
5
+ export * from "./XmlTextType";
package/dist/index.js ADDED
@@ -0,0 +1,28 @@
1
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2
+ if (k2 === undefined) k2 = k;
3
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ }) : (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ o[k2] = m[k];
7
+ }));
8
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
9
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
10
+ };
11
+ (function (factory) {
12
+ if (typeof module === "object" && typeof module.exports === "object") {
13
+ var v = factory(require, exports);
14
+ if (v !== undefined) module.exports = v;
15
+ }
16
+ else if (typeof define === "function" && define.amd) {
17
+ define(["require", "exports", "./XmlDocument", "./XmlElement", "./XmlAttribute", "./XmlTokenType", "./XmlTextType"], factory);
18
+ }
19
+ })(function (require, exports) {
20
+ "use strict";
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ __exportStar(require("./XmlDocument"), exports);
23
+ __exportStar(require("./XmlElement"), exports);
24
+ __exportStar(require("./XmlAttribute"), exports);
25
+ __exportStar(require("./XmlTokenType"), exports);
26
+ __exportStar(require("./XmlTextType"), exports);
27
+ });
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;IAAA,gDAA6B;IAC7B,+CAA4B;IAC5B,iDAA8B;IAC9B,iDAA8B;IAC9B,gDAA6B"}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "nlptoolkit-xmlparser",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Simple Xml Parser",
5
- "main": "index.js",
6
- "types": "index.js",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
7
  "scripts": {
8
8
  "test": "Mocha"
9
9
  },
@@ -1,12 +1,11 @@
1
1
  export class XmlAttribute {
2
2
 
3
- private name: string
3
+ private readonly name: string
4
4
  private value: string
5
5
 
6
6
  /**
7
7
  * Constructor for xml attribute. Initializes the attribute.
8
8
  * @param name Name of the attribute
9
- * @return Allocated and initialized attribute
10
9
  */
11
10
  constructor(name: string) {
12
11
  this.name = name
@@ -13,7 +13,6 @@ export class XmlElement {
13
13
  * Constructor for xml element. Allocates memory and initializes an element.
14
14
  * @param name Name of the element
15
15
  * @param parent Parent of the Xml Element
16
- * @return Constructed element
17
16
  */
18
17
  constructor(name: string, parent: XmlElement) {
19
18
  this.name = name
@@ -0,0 +1,5 @@
1
+ export * from "../dist/XmlDocument";
2
+ export * from "../dist/XmlElement";
3
+ export * from "../dist/XmlAttribute";
4
+ export * from "../dist/XmlTokenType";
5
+ export * from "../dist/XmlTextType";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("../dist/XmlDocument"), exports);
14
+ __exportStar(require("../dist/XmlElement"), exports);
15
+ __exportStar(require("../dist/XmlAttribute"), exports);
16
+ __exportStar(require("../dist/XmlTokenType"), exports);
17
+ __exportStar(require("../dist/XmlTextType"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAkC;AAClC,oDAAiC;AACjC,sDAAmC;AACnC,sDAAmC;AACnC,qDAAkC"}
@@ -0,0 +1,5 @@
1
+ export * from "./XmlDocument"
2
+ export * from "./XmlElement"
3
+ export * from "./XmlAttribute"
4
+ export * from "./XmlTokenType"
5
+ export * from "./XmlTextType"
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const assert = require("assert");
4
+ const XmlDocument_1 = require("../dist/XmlDocument");
5
+ describe('XmlTest', function () {
6
+ describe('Read test', function () {
7
+ it('Checks reading of xml file', function () {
8
+ var doc = new XmlDocument_1.XmlDocument("test.xml");
9
+ doc.parse();
10
+ let root = doc.getFirstChild();
11
+ assert.strictEqual("frameset", root.getName());
12
+ let firstChild = root.getFirstChild();
13
+ assert.strictEqual("role", firstChild.getName());
14
+ assert.strictEqual("ali veli \"deneme yapmak\" = anlamında > bir deyim", firstChild.getPcData());
15
+ let secondChild = firstChild.getNextSibling();
16
+ assert.strictEqual("perceiver, alien \"x3\" to whom?", secondChild.getAttributeValue("descr"));
17
+ assert.strictEqual("PAG", secondChild.getAttributeValue("f"));
18
+ assert.strictEqual("2", secondChild.getAttributeValue("n"));
19
+ });
20
+ });
21
+ });
22
+ //# sourceMappingURL=XmlDocumentTest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XmlDocumentTest.js","sourceRoot":"","sources":["XmlDocumentTest.ts"],"names":[],"mappings":";;AAAA,iCAAiC;AACjC,qDAAgD;AAEhD,QAAQ,CAAC,SAAS,EAAE;IAChB,QAAQ,CAAC,WAAW,EAAE;QAClB,EAAE,CAAC,4BAA4B,EAAE;YAC7B,IAAI,GAAG,GAAG,IAAI,yBAAW,CAAC,UAAU,CAAC,CAAA;YACrC,GAAG,CAAC,KAAK,EAAE,CAAA;YACX,IAAI,IAAI,GAAG,GAAG,CAAC,aAAa,EAAE,CAAA;YAC9B,MAAM,CAAC,WAAW,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;YAC9C,IAAI,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,CAAA;YACrC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,CAAA;YAChD,MAAM,CAAC,WAAW,CAAC,oDAAoD,EAAE,UAAU,CAAC,SAAS,EAAE,CAAC,CAAA;YAChG,IAAI,WAAW,GAAG,UAAU,CAAC,cAAc,EAAE,CAAA;YAC7C,MAAM,CAAC,WAAW,CAAC,kCAAkC,EAAE,WAAW,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAA;YAC9F,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAA;YAC7D,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,WAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAA;QAC/D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
package/tsconfig.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "module": "commonjs",
4
- "target": "es5",
4
+ "target": "es2018",
5
5
  "sourceMap": true,
6
6
  "noImplicitAny": true,
7
7
  "removeComments": false,
8
- "moduleResolution": "node"
8
+ "moduleResolution": "node",
9
+ "declaration": true,
10
+ "strict": true
9
11
  },
10
12
  "exclude": [
11
- "source",
12
13
  "node_modules",
13
14
  "dist"
14
15
  ]
package/index.js DELETED
@@ -1,5 +0,0 @@
1
- export * from "./dist/XmlDocument"
2
- export * from "./dist/XmlElement"
3
- export * from "./dist/XmlAttribute"
4
- export * from "./dist/XmlTokenType"
5
- export * from "./dist/XmlTextType"