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

Validate multiple schemas/models on single file? #32

Open
adsummertech opened this issue Mar 9, 2023 · 2 comments
Open

Validate multiple schemas/models on single file? #32

adsummertech opened this issue Mar 9, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@adsummertech
Copy link

adsummertech commented Mar 9, 2023

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.

@raffazizzi raffazizzi added the enhancement New feature or request label Mar 9, 2023
@raffazizzi
Copy link
Owner

Hello, the extension currently does not support validation with multiple schemas. I will label this issue as a possible future enhancement.

@adsummertech
Copy link
Author

That'd be great, thanks @raffazizzi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants