@openenergytools/scl-template-validator
v0.0.3
Published
A NSD based validator for data type templates in the SCL
Downloads
1
Readme
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
lnClass
attribute - missing mandatory child data object (e.g.
Beh
inLLN0
)
- missing
DOType
- missing
cdc
attribute - incorrect
cdc
(e.g. DO.Beh is referencing a DOType with cdc="APC") - missing mandatory child data attributes (e.g.
Open
withctlModel
anything else thanstatus-only
)
- missing
DAType
- missing mandatory child data attributes (e.g.
ctlVal
inOper
)
- missing mandatory child data attributes (e.g.
DO or SDO
- missing
type
attribute - invalid reference to
DOType
- missing
DA or BDA
- missing
type
attribute forStruct
andEnum
type data attributes - invalid reference to
DAType
- missing