Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow XmlDocumentReader to skip elements not in schema instead of fail #4062

Open
mherwege opened this issue Jan 24, 2024 · 1 comment
Open
Labels
enhancement An enhancement or new feature of the Core

Comments

@mherwege
Copy link
Contributor

See discussion openhab/openhab-addons#16060 (comment)

To my knowlege, all reading of xml files will fail if the xml file contains elements that are not in the schema (and code).

For 4.1, we enhance the addon.xml schema, adding discovery-methods. This works fine in 4.1. But it has been brought to our attention that it does mean bindings compiled for 4.1 will not work anymore on a 4.0 installation, even when all else would, this due to the fact that discovery-methods is not recognized.

It is too late to solve this for 4.0, but to avoid such situations in the future (when something else would be added), it would be nice of we could log and ignore the extra elements, instead of failing completely.

This requires changing the core to not throw an error on unrecognized elements, but log and skip. Something similar could be required for the attribute checking.

I am OK trying a change on this, but want to validate that this is acceptable before doing so. The current check is very strict and this may have broad consequences.

@mherwege mherwege added the enhancement An enhancement or new feature of the Core label Jan 24, 2024
@andrewfg
Copy link
Contributor

@mherwege I would support this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core
Projects
None yet
Development

No branches or pull requests

2 participants