This commit is contained in:
amitm02
2018-08-29 18:36:48 +03:00
parent a710483918
commit 010fde6258
17 changed files with 140 additions and 12 deletions

View File

@ -3,11 +3,17 @@ import { IXmlableObject } from "./xmlable-object";
export { BaseXmlComponent };
export abstract class XmlComponent extends BaseXmlComponent {
protected root: Array<BaseXmlComponent | string>;
public root: Array<BaseXmlComponent | string>;
constructor(rootKey: string) {
constructor(rootKey: string, initContent? : XmlComponent) {
super(rootKey);
this.root = new Array<BaseXmlComponent>();
this.root = initContent ? initContent.root : new Array<BaseXmlComponent>();
if (initContent) {
console.log('\n\n-------\n\n');
console.log('new root', JSON.stringify(initContent, null,2));
console.log('\n\n-------\n\n');
}
}
public prepForXml(): IXmlableObject {