vscode-sxml
vscode-sxml copied to clipboard
Validate multiple schemas/models on single file?
Hi.
I'm trying to use this extension to validate schemas for Odoo XML, it works somewhat fine with the base fields using the XML below:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model
href="https://raw.githubusercontent.com/odoo/odoo/16.0/odoo/import_xml.rng"
schematypens="http://relaxng.org/ns/structure/1.0"
type="application/xml"?>
However in addition to the import_xml.rng file they also have additional RNG files for various tags here: https://github.com/odoo/odoo/tree/16.0/odoo/addons/base/rng
I'd like to also at least validate tree_view.rng file as it's not in the import_xml.rng file.
I tried adding an additional<?xml-model?>
tag that points to the tree_view.rng file, as per the w3c spec example at the bottom here https://www.w3.org/XML/2010/01/xml-model/#d29e669
<?xml-model href="https://raw.githubusercontent.com/odoo/odoo/16.0/odoo/import_xml.rng"
schematypens="http://relaxng.org/ns/structure/1.0"
type="application/xml"?>
<?xml-model href="https://raw.githubusercontent.com/odoo/odoo/16.0/odoo/addons/base/rng/tree_view.rng"
schematypens="http://relaxng.org/ns/structure/1.0"
type="application/xml"?>
However this doesn't seem to work, it's not offering any completion or errors on invalid attributes on my <tree>
tags.
Does this extension support multiple schemas?
Apologies if I'm not understanding how this works correctly as I have not worked with XML validation before, any help would be appreciated.
Hello, the extension currently does not support validation with multiple schemas. I will label this issue as a possible future enhancement.
That'd be great, thanks @raffazizzi