0.0.3 • Published 2 years ago
@openenergytools/scl-template-validator v0.0.3
scl-template-validator
This repository checks the DataTypeTemplates section of an System Configuration Language (SCL) file for issues that are not specified in the XSD. The validation is done with the help of NameSpaceDescription (NSD) files. As such the validation can only be performed for Edition 2.1 and higher as only for those version NSD files exist.
The validator is returning issues asynchronously in chunks grouped to the elements in the data type templates section and does so though a generator. You can use the validate generator like so:
for await (const issueGroup of validate(this.doc)) {
// DO something with the Issue[]
}Validation per element group
The template validation is at the moment very rudimentary:
LNodeType
- missing
lnClassattribute - missing mandatory child data object (e.g.
BehinLLN0)
- missing
DOType
- missing
cdcattribute - incorrect
cdc(e.g. DO.Beh is referencing a DOType with cdc="APC") - missing mandatory child data attributes (e.g.
OpenwithctlModelanything else thanstatus-only)
- missing
DAType
- missing mandatory child data attributes (e.g.
ctlValinOper)
- missing mandatory child data attributes (e.g.
DO or SDO
- missing
typeattribute - invalid reference to
DOType
- missing
DA or BDA
- missing
typeattribute forStructandEnumtype data attributes - invalid reference to
DAType
- missing