[x3d-public] Released to the Public Domain--How to configure Schematron in Java

John Carlson yottzumm at gmail.com
Wed Jul 30 07:25:50 PDT 2025


Add to your X3DJSAIL.properties file in your CLASSPATH

STYLESHEET_X3DSCHEMATRON_SVRLREPORT="../lib/stylesheets/SvrlReportText.xslt";
STYLESHEET_X3DSCHEMATRON="../lib/stylesheets/X3dSchematronValidityChecks.xslt";

Pick the correct paths you wish.

In CoderSchematron.java

import org.web3d.x3d.jsail.CommandLine;

public class CoderSchematron {
        public static void main(String args[]) {
                for (int a = 0; a < args.length; a++) {
                        try {
                                String source = args[a];
                                org.web3d.x3d.jsail.CommandLine.main(new
String[] {
                                        "-schematron",
                                        source,
                                        "-tofile",
                                        source+".new.schematron.txt"
                                });
                        } catch (Exception e) {
                                e.printStackTrace();
                        }
                }
        }
}

Compile:

> javac -cp '.;X3DJSAIL.4.0.jar' CoderSchematron.java   # windows

run!

> java -cp '.;X3DJSAIL.4.0.jar' CoderSchematron file1.x3d file2.x3d
file3.x3d

Pickup results in file1.x3d.new.schematron.txt file2.x3d.new.schematron.txt
file3.x3d.new.schematron.txt

Great!  It's still slow as molasses.  Maybe we can try compiled stylesheets?

Thanks!

John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20250730/8cf9d13a/attachment.html>


More information about the x3d-public mailing list