Skip to content
Snippets Groups Projects
Commit 648b0359 authored by Jan Loewe's avatar Jan Loewe :speech_balloon:
Browse files

Merge branch 'feat-dcc-v-3-2' into 'master'

Update to DCC Schema V3.2

See merge request !4
parents c7a5cf1e d4808684
No related branches found
No related tags found
1 merge request!4Update to DCC Schema V3.2
......@@ -38,7 +38,7 @@ const doc = DCCDocument.fromXml(xml);
// access the properties of the DCC
// _attr contains all the attributes of a given element
doc.digitalCalibrationCertificate._attr.schemaVersion // => 3.1.2
doc.digitalCalibrationCertificate._attr.schemaVersion // => 3.2.0
// _text is used to access the value of the given element
doc.digitalCalibrationCertificate.administrativeData.coreData.uniqueIdentifier._text
......@@ -48,7 +48,7 @@ console.log(doc.toXML()); // => <valid dcc xml>
## License
Copyright 2021 Physikalisch-Technische Bundesanstalt, Bundesallee 100, 38116 Braunschweig, GERMANY
Copyright 2021 - 2023 Physikalisch-Technische Bundesanstalt, Bundesallee 100, 38116 Braunschweig, GERMANY
Licensed under the EUPL, Version 1.2 or – as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence");
You may not use this work except in compliance with the Licence.
......
export interface INamespaced {
get namespace(): string;
get ns(): string;
}
This diff is collapsed.
......@@ -66,7 +66,7 @@ export class DCCDocument {
elementNameFn: function (val, currentElementObj) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const currentElement = <any>currentElementObj;
return `${currentElement?.namespace ? `${currentElement.namespace}:` : ""}${val}`;
return `${currentElement?.ns ? `${currentElement.ns}:` : ""}${val}`;
},
});
}
......
......@@ -13,31 +13,31 @@ export const DSI: ISchemaInformation = {
};
export class SIXMLElement extends XMLElement implements INamespaced {
get namespace() {
get ns() {
return DSI.namespace;
}
}
export class SIXMLBoolean extends XMLBoolean implements INamespaced {
get namespace() {
get ns() {
return DSI.namespace;
}
}
export class SIXMLDate extends XMLDate implements INamespaced {
get namespace() {
get ns() {
return DSI.namespace;
}
}
export class SIXMLNumber extends XMLNumber implements INamespaced {
get namespace() {
get ns() {
return DSI.namespace;
}
}
export class SIXMLList extends XMLList implements INamespaced {
get namespace() {
get ns() {
return DSI.namespace;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment