Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • d-ptb/dcc/development/dcc-js
1 result
Show changes
Commits on Source (22)
{
"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.
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
{
"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;
}
}
......