works!
This commit is contained in:
@ -7,6 +7,8 @@ export const parseOptions = {
|
||||
ignoreAttributes: false,
|
||||
attributeNamePrefix: "",
|
||||
attrNodeName: "_attr",
|
||||
textNodeName: '',
|
||||
trimValues: false
|
||||
};
|
||||
|
||||
/**
|
||||
@ -57,6 +59,7 @@ export class ImportedXmlComponent extends XmlComponent {
|
||||
private _attr: any;
|
||||
|
||||
constructor(rootKey: string, _attr?: any) {
|
||||
|
||||
super(rootKey);
|
||||
if (_attr) {
|
||||
this._attr = _attr;
|
||||
|
@ -8,12 +8,6 @@ export abstract class XmlComponent extends BaseXmlComponent {
|
||||
constructor(rootKey: string, initContent? : XmlComponent) {
|
||||
super(rootKey);
|
||||
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 {
|
||||
@ -30,7 +24,7 @@ export abstract class XmlComponent extends BaseXmlComponent {
|
||||
}
|
||||
return comp;
|
||||
})
|
||||
.filter((comp) => comp); // Exclude null, undefined, and empty strings
|
||||
.filter((comp) => comp !== null); // Exclude null, undefined, and empty strings
|
||||
return {
|
||||
[this.rootKey]: children,
|
||||
};
|
||||
|
Reference in New Issue
Block a user