Skip to content

Commit 0736b83

Browse files
committed
feat: add instructions for schema use
1 parent 9641d3c commit 0736b83

1 file changed

Lines changed: 28 additions & 1 deletion

File tree

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,35 @@
11
# oscd-extensions
2+
23
Here we are collecting extension namespaces to IEC 61850-6 used within the OpenSCD ecosystem.
34

4-
If you have identified a need for an extension namespace that in your opinion is of use for the OpenSCD ecosystem and not for your individual project feel free to open a PR with a XSD file defining the namespace.
5+
If you have identified a need for an extension namespace that in your opinion is of use for the OpenSCD ecosystem and not for your individual project feel free to open a PR with a XSD file defining the namespace.
56

67
> Please make sure to check existing namespaces before proposing a new one. We generally want to avoid multiple namespaces for the same purpose. If an existing namespace is somewhat but not fully serving your purpose, please request a change to this one first.
78
89
> Please be aware that adding a new namespace here is something which is likely to require considerable debate and discussion and take some time. Once agreed, concerns around extendability, maintenance and backwards compatibility will be important. The review process is something we take seriously and we may request changes along the way.
10+
11+
## Verifying a file with a schema
12+
13+
To use a schema for validating an SCL file in a text editor, add a schema reference to it.
14+
For instance if the schema is in the same folder as the SCL file, add a schema reference as follows to the SCL element by adding a namespaced attribute.
15+
For example with the SLD schema:
16+
17+
```xml
18+
<SCL ... xsi:schemaLocation="https://openscd.org/SCL/SSD/SLD/v0 ssd-sld-v0.xsd" ...>
19+
```
20+
21+
You will also need to ensure the `xsi` schema is defined on the document element:
22+
23+
```xml
24+
<SCL ... xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...>
25+
```
26+
27+
On an SCL document element this could look like:
28+
29+
```xml
30+
<SCL xmlns="http://www.iec.ch/61850/2003/SCL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
31+
version="2007" revision="B" release="4" xmlns:eosld="https://openscd.org/SCL/SSD/SLD/v0"
32+
xsi:schemaLocation="https://openscd.org/SCL/SSD/SLD/v0 ssd-sld-v0.xsd">
33+
```
34+
35+
This is known to work with e.g. the XML Tools extension in VS Code.

0 commit comments

Comments
 (0)