Page 1 of 1

How to hook a custom validator into a Document Type framework?

Posted: Wed Oct 15, 2025 10:59 am
by hostchick
Hi admin,
I'm developing a custom Document Type in Oxygen XML and would like to integrate a custom validation engine (not based on XSD/RelaxNG/DTD).
Is there a way to hook a custom validator into the framework so that:
It runs automatically during document editing (on save or on demand)?
Validation results are displayed in the Problems panel like standard errors?
If possible, could you point me to a sample plugin or API interface to implement this?
Thanks in advance!

Re: How to hook a custom validator into a Document Type framework?

Posted: Thu Oct 16, 2025 9:12 am
by tavy
Hello,

To create a custom validator in Oxygen XML Editor, you have two main options:

1. Configure an External Validation Engine
You can add an external validator (such as a command-line tool) via the Custom Validation Engines preferences:

- Go to Options > Preferences > Editor > Document Validation > Custom Validation Engines.
- Click New to add a custom validator.
- Specify the Name, Executable path, Working directory, and Command-line arguments for your tool.
- You can use editor variables like ${cf} (current file), ${ds} (detected schema), etc., in your command-line arguments.
Once configured, your custom validator will appear in the Validation toolbar drop-down menu and can be used to validate documents.
See more details here: https://www.oxygenxml.com/doc/versions/ ... ation.html

2. Implement a Validator Plugin
If you want deeper integration, you can create a plugin:

- Implement the ro.sync.exml.plugin.validator.ValidatorPluginExtension interface in your plugin.
- In your plugin descriptor, add:

Code: Select all

<extension type="DocumentValidator" class="my.validator.plugin.extension"/>
After installing the plugin, your custom engine will be available in validation scenarios.
See plugin extension details here: https://www.oxygenxml.com/doc/versions/ ... nsion.html
For more on configuring and using custom validators, see the Custom Validators documentation: https://www.oxygenxml.com/doc/versions/ ... ation.html

Best Regards,
Octavian