Run a Schematron validation scenario programmatically
Are you missing a feature? Request its implementation here.
Run a Schematron validation scenario programmatically
Good afternoon,
Based on ticket post74532.html#p74532, we understand that it is only possible to programmatically run a Schematron validation scenario in Oxygen Desktop.
We would like to request the implementation of this feature in Oxygen XML Editor Web.
We are working with S1000D, where each project has its own Schematron with specific rules. Since our framework is designed to serve the application as a whole, we face the challenge of validating BREX information via Schematron for each project.
To address this issue, we had to extend our ".framework". In this extension, we manually linked the validation scenario to the corresponding project. However, if we could programmatically select the validation scenario via Java or JavaScript, we wouldn’t need to create specific extensions for each project.
In ticket 74532, it was stated that the ValidationScenarioInvoker.ValidationScenarios() method works only in the Oxygen Desktop version. Therefore, our feature request is to enable this validation to be invoked via Java in the Web environment as well.
Thank you very much for your attention.
Based on ticket post74532.html#p74532, we understand that it is only possible to programmatically run a Schematron validation scenario in Oxygen Desktop.
We would like to request the implementation of this feature in Oxygen XML Editor Web.
We are working with S1000D, where each project has its own Schematron with specific rules. Since our framework is designed to serve the application as a whole, we face the challenge of validating BREX information via Schematron for each project.
To address this issue, we had to extend our ".framework". In this extension, we manually linked the validation scenario to the corresponding project. However, if we could programmatically select the validation scenario via Java or JavaScript, we wouldn’t need to create specific extensions for each project.
In ticket 74532, it was stated that the ValidationScenarioInvoker.ValidationScenarios() method works only in the Oxygen Desktop version. Therefore, our feature request is to enable this validation to be invoked via Java in the Web environment as well.
Thank you very much for your attention.
Re: Run a Schematron validation scenario programmatically
Hello,
Thank you for contacting us.
In response to your request, we would like to suggest an alternative approach using the schematron.imposed.phase URL parameter [1].
The schematron.imposed.phase URL parameter is used to specify a particular phase of a Schematron schema to be applied when validating a document in Oxygen XML Web Author. This allows you to control which parts of the Schematron rules are executed during validation.
Do you think this alternative meets your needs?
Best,
Cosmin
Thank you for contacting us.
In response to your request, we would like to suggest an alternative approach using the schematron.imposed.phase URL parameter [1].
The schematron.imposed.phase URL parameter is used to specify a particular phase of a Schematron schema to be applied when validating a document in Oxygen XML Web Author. This allows you to control which parts of the Schematron rules are executed during validation.
Do you think this alternative meets your needs?
Best,
Cosmin
Cosmin Eftenie
www.oxygenxml.com
www.oxygenxml.com
Re: Run a Schematron validation scenario programmatically
Hello, Cosmin!
We are currently using your suggestion. We are sending the schematron.imposed.phase via URL and successfully validating the rules.
However, in our business, each model in S1000D uses at least three different Schematron files, each containing an average of 300 validations.
Initially, we compiled these three files into a single file and passed the phase via URL.
However, in the future, we will have around 20 different models, each with its own three Schematron files. If we consolidate all these validations into a single file, it might become so large that it won't even open, and it could potentially cause performance issues in the system.
Therefore, we believe it would be better to have the option to select the validation file directly via Java instead of just the phase. Additionally, it would be interesting if we could choose the Schematron validation file directly via URL instead of selecting only the phase. That would also address this issue.
We are currently using your suggestion. We are sending the schematron.imposed.phase via URL and successfully validating the rules.
However, in our business, each model in S1000D uses at least three different Schematron files, each containing an average of 300 validations.
Initially, we compiled these three files into a single file and passed the phase via URL.
However, in the future, we will have around 20 different models, each with its own three Schematron files. If we consolidate all these validations into a single file, it might become so large that it won't even open, and it could potentially cause performance issues in the system.
Therefore, we believe it would be better to have the option to select the validation file directly via Java instead of just the phase. Additionally, it would be interesting if we could choose the Schematron validation file directly via URL instead of selecting only the phase. That would also address this issue.
Re: Run a Schematron validation scenario programmatically
Hi,
A possible workaround could be to use a validation scenario that points to a schema using editor variables:
In this example, ${cfdu} is resolved to the path of the curent file directory.
You can create a custom handler that handles these requests and returns your desired schema:
Hope this helps,
Mircea
A possible workaround could be to use a validation scenario that points to a schema using editor variables:
- example.png (531.53 KiB) Viewed 277 times
You can create a custom handler that handles these requests and returns your desired schema:
Code: Select all
PluginWorkspaceProvider.getPluginWorkspace().getXMLUtilAccess().addPriorityURIResolver(
new URIResolver() {
@Override
public Source resolve(String href, String base) throws TransformerException {
if (href.endsWith("dynamic-schema.sch")) {
if (base.contains("project1")) {
// TODO: return schema for project 1
} else if (base.contains("project2")) {
// TODO: return schema for project 2
}
}
// Let another handler handle this
return null;
}
});
Hope this helps,
Mircea
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service