How can I use a customized java service for xml validation ?
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 124
- Joined: Tue May 29, 2012 5:42 pm
How can I use a customized java service for xml validation ?
Post by sebastienlavandier »
Hello,
We have a specific xml document, that contains a list of rules, with for each case : an xpath, a test and a warning message which must appear if the test are wrong. It's a normed document we can't make otherwise !
The problem is that document is not a standard xml validation format like .xsd, or schematron, ...
So, I want to know if it's possible to use a custom java api (or an other solution) in Oxygen Author to validate xml documents.
Do you have some ideas ?
Thanks in advance for your answers.
We have a specific xml document, that contains a list of rules, with for each case : an xpath, a test and a warning message which must appear if the test are wrong. It's a normed document we can't make otherwise !
The problem is that document is not a standard xml validation format like .xsd, or schematron, ...
So, I want to know if it's possible to use a custom java api (or an other solution) in Oxygen Author to validate xml documents.
Do you have some ideas ?
Thanks in advance for your answers.
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How can I use a customized java service for xml validation ?
Hi Sebastien,
This is for the standalone version of Oxygen, right?
Have you implemented a Workspace Access plugin until now using our Plugins SDK?
One possibility would be to use for validation a very simple XML Schema in order for Oxygen to automatically validate the file each time the user modifies it.
Then we have some API like:
which would notify you each time Oxygen is validating the document and allow you to add additional errors in the list of detected errors.
Regards,
Radu
This is for the standalone version of Oxygen, right?
Have you implemented a Workspace Access plugin until now using our Plugins SDK?
One possibility would be to use for validation a very simple XML Schema in order for Oxygen to automatically validate the file each time the user modifies it.
Then we have some API like:
Code: Select all
ro.sync.exml.workspace.api.editor.WSEditor.addValidationProblemsFilter(ValidationProblemsFilter)
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 124
- Joined: Tue May 29, 2012 5:42 pm
Re: How can I use a customized java service for xml validation ?
Post by sebastienlavandier »
Hi Radu,
Thanks you for your answer.
I trying to implement your solution, and for do that I must instantiate a "DocumentPositionedInfo".
Now my problem is how to know what are the parameters of the DocumentPositionedInfo constructor ?
I don't find informations for this class.
Do you have an example or some informations about the attributes of the class ?
Thanks in advance.
Thanks you for your answer.
I trying to implement your solution, and for do that I must instantiate a "DocumentPositionedInfo".
Now my problem is how to know what are the parameters of the DocumentPositionedInfo constructor ?
I don't find informations for this class.
Do you have an example or some informations about the attributes of the class ?
Thanks in advance.
-
- Posts: 124
- Joined: Tue May 29, 2012 5:42 pm
Re: How can I use a customized java service for xml validation ?
Post by sebastienlavandier »
Hello Radu,Radu wrote: Then we have some API like:
which would notify you each time Oxygen is validating the document and allow you to add additional errors in the list of detected errors.Code: Select all
ro.sync.exml.workspace.api.editor.WSEditor.addValidationProblemsFilter(ValidationProblemsFilter)
Regards,
Radu
I'm trying again your solution and I want to know, how I can detected when Oxygen is validating the document.
Thanks you for your answer.
seb.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: How can I use a customized java service for xml validation ?
Post by sorin_ristache »
Hi Sebastien,
As you can see in the documentation of the DocumentPositionedInfo class there are many constructors that allow you to create one message for adding it to one output view (in your case the Errors view where the validation error messages are displayed). Depending on the number of details that you have about an error (the location of the validated file, line and column of the error, the text of the error message, the severity of the message - warning, error, etc) you should call the appropriate constructor in your Workspace plugin for each message that will go in the output view.
Regards,
Sorin
The DocumentPositionedInfo class was missing from the javadoc of the Plugins API. Now we updated the javadoc on the website and also the Plugins SDK to include this class. You can download the SDK again if you want to have the new complete javadoc also on your computer.sebastienlavandier wrote:I trying to implement your solution, and for do that I must instantiate a "DocumentPositionedInfo".
Now my problem is how to know what are the parameters of the DocumentPositionedInfo constructor ?
I don't find informations for this class.
As you can see in the documentation of the DocumentPositionedInfo class there are many constructors that allow you to create one message for adding it to one output view (in your case the Errors view where the validation error messages are displayed). Depending on the number of details that you have about an error (the location of the validated file, line and column of the error, the text of the error message, the severity of the message - warning, error, etc) you should call the appropriate constructor in your Workspace plugin for each message that will go in the output view.
Regards,
Sorin
-
- Posts: 124
- Joined: Tue May 29, 2012 5:42 pm
Re: How can I use a customized java service for xml validation ?
Post by sebastienlavandier »
Hello,
Thanks you for your answer.
When the XML document is validated (automaticaly / Manualy), a list of messages is generated in the error widget.
Now I want to put some others messages in this list.
To do that, I must detected when Oxygen is validating the XML document.
How I can do that ?
I don't find a corresponding listener or other solution.
Thanks in advance for your answer.
Thanks you for your answer.
When the XML document is validated (automaticaly / Manualy), a list of messages is generated in the error widget.
Now I want to put some others messages in this list.
To do that, I must detected when Oxygen is validating the XML document.
How I can do that ?
I don't find a corresponding listener or other solution.
Thanks in advance for your answer.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: How can I use a customized java service for xml validation ?
Post by sorin_ristache »
Hi Sébastien,
Regards,
Sorin
Your implementation of the listener interface ValidationProblemsFilter (which is part of your Workspace plugin and which is registered by calling the WSEditor.addValidationProblemsFilter() method) is called every time there is a validation in the editor panel where the validated document is edited. The validation can be manual (started by the Oxygen user pressing the Validate button on the Toolbar or going to menu Document -> Validate -> Validate) or automatic (the automatic validation is enabled from menu Options -> Preferences -> Editor -> Document Checking -- Enable automatic validation). In both types of validation you (as the implementer of the Workspace plugin) don't (and can't) do anything to start the validation. Your listener of type ValidationProblemsFilter is simply called when a validation takes place in an Oxygen editor panel. You can add, remove or modify the marker messages displayed in the output Oxygen view (in your case the Errors view) by modifying the list returned by ro.sync.exml.workspace.api.editor.validation.ValidationProblems.getProblemsList() which you can call inside your implementation of ValidationProblemsFilter.filterValidationProblems().sebastienlavandier wrote:I'm trying again your solution and I want to know, how I can detected when Oxygen is validating the document.
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: How can I use a customized java service for xml validation ?
Post by sorin_ristache »
Hi Sébastien,
Your listener of type ValidationProblemsFilter will be called by Oxygen only when a validation takes place in the editor panel(s) for which you registered the listener, that is only for the editor panel(s) for which you called the WSEditor.addValidationProblemsFilter() method. In your Workspace plugin you decide for which editor panels (WSEditor instances) you want to be notified.
Regards,
Sorin
Your listener of type ValidationProblemsFilter will be called by Oxygen only when a validation takes place in the editor panel(s) for which you registered the listener, that is only for the editor panel(s) for which you called the WSEditor.addValidationProblemsFilter() method. In your Workspace plugin you decide for which editor panels (WSEditor instances) you want to be notified.
Regards,
Sorin
-
- Posts: 124
- Joined: Tue May 29, 2012 5:42 pm
Re: How can I use a customized java service for xml validation ?
Post by sebastienlavandier »
Hi Sorin,
It work well !
Thank you for your help.
Bye
It work well !
Thank you for your help.
Bye
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