Comparing version
@@ -21,2 +21,3 @@ /******************************************************************************* | ||
private content; | ||
documentType: XMLDocumentType; | ||
constructor(); | ||
@@ -23,0 +24,0 @@ contentIterator(): IterableIterator<XMLNode>; |
@@ -16,5 +16,3 @@ "use strict"; | ||
const Constants_1 = require("./Constants"); | ||
const TextNode_1 = require("./TextNode"); | ||
const XMLDeclaration_1 = require("./XMLDeclaration"); | ||
const XMLDocumentType_1 = require("./XMLDocumentType"); | ||
const XMLElement_1 = require("./XMLElement"); | ||
@@ -24,2 +22,3 @@ const XMLUtils_1 = require("./XMLUtils"); | ||
content; | ||
documentType; | ||
constructor() { | ||
@@ -43,17 +42,8 @@ this.content = new Array(); | ||
setDocumentType(documentType) { | ||
if (this.content.length > 0) { | ||
let firstNode = this.content[0]; | ||
if (firstNode instanceof XMLDeclaration_1.XMLDeclaration) { | ||
this.content.splice(1, 0, new TextNode_1.TextNode('\n')); | ||
this.content.splice(2, 0, documentType); | ||
return; | ||
} | ||
} | ||
this.content.splice(0, 0, documentType); | ||
this.documentType = documentType; | ||
this.content.push(documentType); | ||
} | ||
getDocumentType() { | ||
for (let node of this.content) { | ||
if (node instanceof XMLDocumentType_1.XMLDocumentType) { | ||
return node; | ||
} | ||
if (this.documentType) { | ||
return this.documentType; | ||
} | ||
@@ -60,0 +50,0 @@ return undefined; |
{ | ||
"name": "typesxml", | ||
"productName": "TypesXML", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"description": "Open source XML library written in TypeScript", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
282866
-0.29%4362
-0.21%