Skip to content
Snippets Groups Projects
Verified Commit 273bb61e authored by Jan Loewe's avatar Jan Loewe :speech_balloon:
Browse files

Merge remote-tracking branch 'origin/master' into feat-jest-tests

# Conflicts:
#	package-lock.json
parents 63bfb1f3 cb05351e
No related branches found
No related tags found
3 merge requests!10Refactor Test Resources,!6Adaptations for new DCC V3.2.1,!5Add tests
Pipeline #18568 passed
This commit is part of merge request !5. Comments created here will be created in the context of that merge request.
{
"printWidth": 160,
"trailingComma": "all",
"singleQuote": false
"singleQuote": false,
"endOfLine": "auto"
}
\ No newline at end of file
......@@ -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.
......
{
"name": "@d-ptb/dcc-js",
"version": "1.3.5",
"version": "1.4.0",
"license": "EUPL-1.2",
"author": "Jan Loewe <jan.loewe@ptb.de>",
"main": "lib/index.js",
......
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