CometVisu / CometVisu

Repository for the CometVisu building automation visualisation.
https://www.cometvisu.org/
Other
63 stars 81 forks source link

XSD schema clean up: addresses #1045

Open ChristianMayer opened 3 years ago

ChristianMayer commented 3 years ago

The XSD schema uses a ORed regex to check for a valid address. This worked well for the KNX GA addresses, but starting with OpenHAB and becoming even worse with MQTT the valid strings for the addresses are not strict any more.

The best solution would be to make the allowed strings depending on the value of the <pages> backend attribute. Possible ways to achieve that might be the XSD features xs:assert or xs:alternative

Also there are a few places that are using the addr type although it might be better to make those a derivation of <address>.

This clean up must make sure that it's still compatible with the visual and the text editor.

peuter commented 3 years ago

Another thing that complicates the address evaluation is that you could basically write something like this in a template: <address transform="OH:switch">Sink_{{ sink }}_Prev</address>. I don't know if its possible, but for address-Elements in templates the address evaluation should be disabled.

peuter commented 3 years ago

The problem with àssert and alternative is that they require the editors to support XSD 1.1. The Text-Editor uses an emscripten compiled version of libxml2, which does not support XSD 1.1.