[oXygen-user] schematron validation in a batch file
Christophe Marchand
cmarchand at oxiane.com
Wed Oct 9 14:22:12 CDT 2019
I think I've presented in pre-conference day at XMLPrague 2019 - not
recorded - a maven plugin that do validation against RelaxNg AND
Schematron, but I can't find code.
It's based on Jim Etevenard's work, located here :
https://github.com/cmarchand/Jing-JAXP-Wrapper
It requires, for ISO-schematron, a patched release of Jing/Trang. You
can find one here, but it's not available on maven central :
https://github.com/ELSGestion/jing-trang/commits/master
Added Jim Etevenard as cc.
Ok, found it : here is an extract of pom.xml, definining
xml-maven-plugin and controls. See dependencies, there are all published
on maven-central, except Jing.
You should be able to write a simple java program that can be used to
validate input files from command line, exploring PIs.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<version>1.0.2</version>
<executions>
<execution>
<goals>
<goal>validate</goal>
</goals>
</execution>
</executions>
<configuration>
<validationSets>
<validationSet>
<dir>src/main/resources/eu/els/sie/publication/conf/env</dir>
<includes>
<include>*.xml</include>
</includes>
<systemId>els-conf.ns.rng</systemId>
<schemaLanguage>http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0</schemaLanguage>
</validationSet>
<validationSet>
<dir>src/main/resources/eu/els/sie/publication/conf/env</dir>
<includes>
<include>*.xml</include>
</includes>
<systemId>flash.sch</systemId>
<schemaLanguage>http://purl.oclc.org/dsdl/schematron</schemaLanguage>
</validationSet>
</validationSets>
<catalogs>target/test-classes/catalogs/catalog.xml</catalogs>
</configuration>
<dependencies>
<dependency>
<groupId>com.jimetevenard.xml</groupId>
<artifactId>Jing-JAXP-Wrapper</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<version>9.8.0-14</version>
</dependency>
<dependency>
<groupId>eu.els.oss</groupId>
<artifactId>jing</artifactId>
<version>20180404</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
</dependencies>
</plugin>
Best regards,
Christophe
Le 09/10/2019 à 11:57, Lou Burnard a écrit :
>
> One of the features of oXygen which I really love is the way it allows
> me to combine schema validation with RELAXNG and with schematron just
> by adding a couple of PIs to the top of my file. But this requires me
> to fire up oXygen and open up each file one by one which is not so
> convenient if I have 100 or more independent documents to validate. I
> would rather do this in a bash script, along with all the other
> pre-validation sanitation work. But
>
> (a) only oXygen will take any notice of my PIs (obviously)
>
> (b) none of the open source validators I've looked at seems to have a
> hook for including schematron validation
>
> (c) oxyGen will do a batch validation of documents included in a
> project file, which is close to what I want, but still requires me to
> fire up oXygen, make the project file and click a couple of times, so
> not really a batch process
>
> Maybe someone else has found a way round this, or could explain to me
> why it's just not possible. And how exactly does oXygen do this magic?
>
>
>
> _______________________________________________
> oXygen-user mailing list
> oXygen-user at oxygenxml.com
> https://www.oxygenxml.com/mailman/listinfo/oxygen-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20191009/3b1af09c/attachment.html>
More information about the oXygen-user
mailing list