Skip to content

Commit

Permalink
Integrate Jing into configure
Browse files Browse the repository at this point in the history
  • Loading branch information
Girgias committed Oct 24, 2024
1 parent bbd9cfa commit 31c7149
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -877,17 +877,23 @@ function getFileModificationHistory(): array {
exit(0); // Tell the shell that this script finished successfully.
} else {
echo "failed.\n";
echo "\nThe document didn't validate, ";
echo "\nThe document didn't validate\n";

/**
* TODO: Integrate jing to explain schema violations as libxml is *useless*
* And this is not going to change for a while as the maintainer of libxml2 even acknowledges:
* > As it stands, libxml2's Relax NG validator doesn't seem suitable for production.
* cf. https://gitlab.gnome.org/GNOME/libxml2/-/issues/448
*/
echo 'Please use Jing and the:' . PHP_EOL
. 'java -jar ./build/jing.jar /path/to/doc-base/docbook/docbook-v5.2-os/rng/docbookxi.rng /path/to/doc-base/.manual.xml' . PHP_EOL
. 'command to check why the RelaxNG schema failed.' . PHP_EOL;
$output = shell_exec('java -jar ./docbook/jing.jar ./docbook/docbook-v5.2-os/rng/docbookxi.rng .manual.xml');
if ($output === null) {
echo "Command failed do you have Java installed?";
} else {
echo $output;
}
//echo 'Please use Jing and the:' . PHP_EOL
// . 'java -jar ./build/jing.jar /path/to/doc-base/docbook/docbook-v5.2-os/rng/docbookxi.rng /path/to/doc-base/.manual.xml' . PHP_EOL
// . 'command to check why the RelaxNG schema failed.' . PHP_EOL;

// Exit normally when don't care about validation
if ($ac["FORCE_DOM_SAVE"] == "yes") {
Expand Down

0 comments on commit 31c7149

Please sign in to comment.