From f48a1e9864e9441dbfe04b922d8172af8b4e230b Mon Sep 17 00:00:00 2001 From: Jan Loewe <jan.loewe@ptb.de> Date: Tue, 14 Feb 2023 14:11:16 +0100 Subject: [PATCH] feat(listType): change choice to maxOccurs="unbounded" --- src/DCC.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/DCC.ts b/src/DCC.ts index 7bec22a..de8eb7c 100644 --- a/src/DCC.ts +++ b/src/DCC.ts @@ -1222,7 +1222,6 @@ export class ListType extends DCCXMLElement { // region choice list?: ListType[]; quantity?: QuantityType[]; - // endregion choice constructor(el: Partial<ListType> = {}) { @@ -1235,9 +1234,9 @@ export class ListType extends DCCXMLElement { if (el.dateTime) this.dateTime = new DCCXMLDate(el.dateTime); else if (el.dateTimeXMLList) this.dateTimeXMLList = new DCCXMLList(el.dateTimeXMLList); - // choice + // choice but maxOccurs = unbounded if (el.list) this.list = ensureArray(el.list).map((x) => new ListType(x)); - else if (el.quantity) this.quantity = ensureArray(el.quantity).map((x) => new QuantityType(x)); + if (el.quantity) this.quantity = ensureArray(el.quantity).map((x) => new QuantityType(x)); if (el.usedMethods) this.usedMethods = new UsedMethodListType(el.usedMethods); if (el.usedSoftware) this.usedSoftware = new SoftwareListType(el.usedSoftware); -- GitLab