How to set up validation with vnu.jar
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 190
- Joined: Wed Apr 20, 2005 5:43 pm
- Location: Victoria, BC, Canada
How to set up validation with vnu.jar
Post by martindholmes »
Hi there,
The epub3 validation Oxygen uses for validating (X)HTML5 files isn't working for us, but vnu.jar works great, so we use it as part of all our build processes. But I'd like to be able to use it to validate HTML5 documents in Oxygen. I'm having some trouble getting this set up. I can create a custom validation engine with vnu.jar as the executable, but Oxygen seems to require a pointer to a schema (either in the document or supplied in the validation engine setup), and without it, it just fails with "VNU is not configured to validate with schema type null". However, VNU doesn't need an external schema. Is there any way to get around this?
All help appreciated,
Martin
The epub3 validation Oxygen uses for validating (X)HTML5 files isn't working for us, but vnu.jar works great, so we use it as part of all our build processes. But I'd like to be able to use it to validate HTML5 documents in Oxygen. I'm having some trouble getting this set up. I can create a custom validation engine with vnu.jar as the executable, but Oxygen seems to require a pointer to a schema (either in the document or supplied in the validation engine setup), and without it, it just fails with "VNU is not configured to validate with schema type null". However, VNU doesn't need an external schema. Is there any way to get around this?
All help appreciated,
Martin
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to set up validation with vnu.jar
Hi Martin,
Indeed I tested the same thing and I confirm your findings, I will add an issue to see if we can improve the custom validation set up.
Problem is that even if you get the custom validation process going it will report some errors in the console which Oxygen will not be able to pick up and properly present because there is no standard for presenting errors in the console. So you can achieve about the same thing by configuring an external tool and running it from time to time.
The better approach would be to create an Oxygen plugin which uses our API to add a custom validation problems filter. The filter could try to call the JAR library in the same Oxygen Java process and obtain some errors from it. Problem is that the large vnu.jar library (22 megabytes) contains a lot of library versions inside it (Xerces, Jing), libraries which have different versions than the ones in Oxygen and produce conflicts. I tried to create such a plugin but encountered conflicts between Oxygen's libraries and the vnu.jar, so the plugin would probably need to start a new process with the validation, then intercept the console output, extract validation information from it and then create error markers for it. Not trivial.
Could you tell me more about your use case? Do you work with not-wellformed HTML documents? Wouldn't it be better to convert them to XHTML seeing that Oxygen would also have trouble editing such documents, it might close the wrong end tags and so on...?
Regards,
Radu
Indeed I tested the same thing and I confirm your findings, I will add an issue to see if we can improve the custom validation set up.
Problem is that even if you get the custom validation process going it will report some errors in the console which Oxygen will not be able to pick up and properly present because there is no standard for presenting errors in the console. So you can achieve about the same thing by configuring an external tool and running it from time to time.
The better approach would be to create an Oxygen plugin which uses our API to add a custom validation problems filter. The filter could try to call the JAR library in the same Oxygen Java process and obtain some errors from it. Problem is that the large vnu.jar library (22 megabytes) contains a lot of library versions inside it (Xerces, Jing), libraries which have different versions than the ones in Oxygen and produce conflicts. I tried to create such a plugin but encountered conflicts between Oxygen's libraries and the vnu.jar, so the plugin would probably need to start a new process with the validation, then intercept the console output, extract validation information from it and then create error markers for it. Not trivial.
Could you tell me more about your use case? Do you work with not-wellformed HTML documents? Wouldn't it be better to convert them to XHTML seeing that Oxygen would also have trouble editing such documents, it might close the wrong end tags and so on...?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 190
- Joined: Wed Apr 20, 2005 5:43 pm
- Location: Victoria, BC, Canada
Re: How to set up validation with vnu.jar
Post by martindholmes »
Sorry Radu, I hadn't seen your request for more info.
The use-case is that the validator built into Oxygen will mark as invalid a bunch of things which are perfectly OK in XHTML5 (such as the <template> element). All my HTML5 documents are well-formed XHTML5, and VNU is a fast and reliable validator for these pages. I typically build VNU validation into my project build processes to check all XHTML5 documents which are generated as part of the build process (typically created from XML using XSLT); it would be nice, though, to be able to hand-edit XHTML5 in Oxygen without getting warned that it's invalid when it's not.
The use-case is that the validator built into Oxygen will mark as invalid a bunch of things which are perfectly OK in XHTML5 (such as the <template> element). All my HTML5 documents are well-formed XHTML5, and VNU is a fast and reliable validator for these pages. I typically build VNU validation into my project build processes to check all XHTML5 documents which are generated as part of the build process (typically created from XML using XSLT); it would be nice, though, to be able to hand-edit XHTML5 in Oxygen without getting warned that it's invalid when it's not.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to set up validation with vnu.jar
Hi Martin,
If you give us some sample XHTML 5 documents which should be valid and are not maybe we can improve on the existing schemas.
We have an issue about integrating the validator nu with Oxygen but I'm not sure when we'll approach this.
Regards,
Radu
If you give us some sample XHTML 5 documents which should be valid and are not maybe we can improve on the existing schemas.
We have an issue about integrating the validator nu with Oxygen but I'm not sure when we'll approach this.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 190
- Joined: Wed Apr 20, 2005 5:43 pm
- Location: Victoria, BC, Canada
Re: How to set up validation with vnu.jar
Post by martindholmes »
Any XHTML5 document using the meta/@property attribute will fail to validate -- here's a simple one:
http://jenkins.hcmc.uvic.ca/job/Mariage ... icles.html
and any HTML5 document that makes use of the element will fail:
http://jenkins.hcmc.uvic.ca/job/Mariage ... icles.html
and any HTML5 document that makes use of the
Code: Select all
<template>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<template></template>
</body>
</html>
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to set up validation with vnu.jar
Hi Martin,
Thanks for the samples, I will add an internal issue to update the schemas we currently use. About the @property attribute on <meta>, I don't seem to find anything in the HTML 5 specification though.
Regards,
Radu
Thanks for the samples, I will add an internal issue to update the schemas we currently use. About the @property attribute on <meta>, I don't seem to find anything in the HTML 5 specification though.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “General XML Questions”
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