How to set up validation with vnu.jar

Questions about XML that are not covered by the other forums should go here.
martindholmes
Posts: 104
Location: Victoria, BC, Canada

How to set up validation with vnu.jar

Mon Dec 05, 2016 8:06 pm

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
Radu
Posts: 5088

Re: How to set up validation with vnu.jar

Tue Dec 06, 2016 11:30 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
martindholmes
Posts: 104
Location: Victoria, BC, Canada

Re: How to set up validation with vnu.jar

Wed Apr 05, 2017 9:31 pm

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.
Radu
Posts: 5088

Re: How to set up validation with vnu.jar

Thu Apr 06, 2017 10:19 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
martindholmes
Posts: 104
Location: Victoria, BC, Canada

Re: How to set up validation with vnu.jar

Fri Apr 07, 2017 3:48 pm

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

Code: Select all

<template>
element will fail:

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>
Radu
Posts: 5088

Re: How to set up validation with vnu.jar

Fri Apr 07, 2017 4:20 pm

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 5088

Re: How to set up validation with vnu.jar

Mon Oct 02, 2017 2:40 pm

Hi,

Oxygen 19.1 was released and it should no longer the XHTML 5 "template" element as invalid.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “General XML Questions”

Who is online

Users browsing this forum: No registered users and 0 guests