From 6a7e66d554b6f86fc4f4a1e33907a061fa572fbd Mon Sep 17 00:00:00 2001 From: Jan Loewe <jan.loewe@ptb.de> Date: Tue, 10 May 2022 13:02:09 +0200 Subject: [PATCH] fix(listType): fix element order --- src/DCC.ts | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/DCC.ts b/src/DCC.ts index 726792d..a4eeea7 100644 --- a/src/DCC.ts +++ b/src/DCC.ts @@ -1,5 +1,14 @@ import * as si from "./DSI"; -import { XMLDate, XMLElement, XMLNumber, XMLBoolean, XMLList, INamespaced, ISchemaInformation, IAttributes } from "./BaseTypes"; +import { + XMLDate, + XMLElement, + XMLNumber, + XMLBoolean, + XMLList, + INamespaced, + ISchemaInformation, + IAttributes, +} from "./BaseTypes"; import { ensureArray } from "./Util"; const schemaVersion = "3.1.2"; @@ -1152,11 +1161,6 @@ export class ListType extends DCCXMLElement { if (el.name) this.name = new TextType(el.name); if (el.description) this.description = new RichContentType(el.description); - if (el.usedMethods) this.usedMethods = new UsedMethodListType(el.usedMethods); - if (el.usedSoftware) this.usedSoftware = new SoftwareListType(el.usedSoftware); - if (el.measuringEquipments) this.measuringEquipments = new MeasuringEquipmentListType(el.measuringEquipments); - if (el.influenceConditions) this.influenceConditions = new InfluenceConditionListType(el.influenceConditions); - if (el.measurementMetaData) this.measurementMetaData = new MeasurementMetaDataListType(el.measurementMetaData); // choice if (el.dateTime) this.dateTime = new DCCXMLDate(el.dateTime); @@ -1165,6 +1169,12 @@ export class ListType extends DCCXMLElement { // choice 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.usedMethods) this.usedMethods = new UsedMethodListType(el.usedMethods); + if (el.usedSoftware) this.usedSoftware = new SoftwareListType(el.usedSoftware); + if (el.measuringEquipments) this.measuringEquipments = new MeasuringEquipmentListType(el.measuringEquipments); + if (el.influenceConditions) this.influenceConditions = new InfluenceConditionListType(el.influenceConditions); + if (el.measurementMetaData) this.measurementMetaData = new MeasurementMetaDataListType(el.measurementMetaData); } } -- GitLab