Bug #5941
closedSaxonC EE 12.1 Validate command line tool seems broken; doesn't give any output
100%
Description
I don't get any output from the SaxonC EE 12.1 command line tool for schema based validation, both on Windows with e.g. PS C:\Program Files\Saxonica\libsaxon-EEC-windows-v12.1\command> .\Validate.exe -t -s:..\samples\data\books-invalid.xml -xsd:..\samples\data\books.xsd
and on Linux with e.g. mh@DESKTOP-TMRJML3:~/libsaxon-EEC-linux-v12.1/command$ ./validate -t -s:../samples/data/books-invalid.xml -xs d:../samples/data/books.xsd
I don't get any output.
Meanwhile SaxonCS 12.1 clearly gives validation errors e.g.
PS C:\Program Files\Saxonica\libsaxon-EEC-windows-v12.1\command> & 'C:\Program Files\Saxonica\SaxonCS-12.0\SaxonCS.exe' validate -t -s:..\samples\data\books-invalid.xml -xsd:..\samples\data\books.xsd
SaxonCS-EE 12.0 from Saxonica
.NET 6.0.10 on Windows 10.0.22621.0
Using license serial number ...
Loading schema document file:///C:/Program Files/Saxonica/libsaxon-EEC-windows-v12.1/samples/data/books.xsd
Finished loading schema document file:///C:/Program Files/Saxonica/libsaxon-EEC-windows-v12.1/samples/data/books.xsd
Schema checking successful. Time: 110ms.
Memory used: 1Mb
Processing file:///C:/Program Files/Saxonica/libsaxon-EEC-windows-v12.1/samples/data/books-invalid.xml
Validation error on line 3 column 5 of books-invalid.xml:
FORG0001: Attribute @x is not allowed on element <BOOKS>
See https://www.w3.org/TR/xmlschema11-1/#cvc-complex-type clause 3
Validation error on line 10 column 23 of books-invalid.xml:
FORG0001: The content "$0.2" of element <PRICE> does not match the required simple type.
Cannot convert string to decimal: $0.2
See https://www.w3.org/TR/xmlschema11-2/#cvc-datatype-valid clause 1
Validation error on line 21 column 32 of books-invalid.xml:
FORG0001: The content "2002-02-31" of element <PUB-DATE> does not match the required
simple type. Invalid date "2002-02-31" (Non-existent date)
See https://www.w3.org/TR/xmlschema11-2/#cvc-datatype-valid clause 1
Validation error on line 42 column 11 of books-invalid.xml:
FORG0001: In content of element <ITEM>: The content model does not allow element
<REPUTATION> to appear immediately after element <WEIGHT>. No further elements are allowed
at this point.
See https://www.w3.org/TR/xmlschema11-1/#cvc-complex-type clause 2.4
Failed to process file ..\samples\data\books-invalid.xml: Four validation errors were reported. First error: Attribute @x is not allowed on element <BOOKS>
Exiting with code 2
I would expect a similar output from the SaxonC EE 12.1 Validate command line tool.
Note I file this on category "Samples" as a category "command line tools" seems to be missing.
Updated by Martin Honnen almost 2 years ago
I have tried SaxonC EE 12.0 now also (only on Windows) but it doesn't show any output as well.
The source code of 12.0 is online although I have no clue how the whole interaction between SaxonC, C/C++, Java, GraalVM work; in https://saxonica.plan.io/projects/saxonmirrorhe/repository/he/revisions/he_mirror_saxon_12_0/entry/src/main/c/command/Validate.c#L32 there is a call to j_run_validate(environi->thread, (void *)processorDataRef);
.
Where is or should that function be implemented?
I suppose in https://saxonica.plan.io/projects/saxonmirrorhe/repository/he/revisions/he_mirror_saxon_12_0/entry/src/main/java/net/sf/saxon/option/cpp/SaxonCAPI.java, perhaps, as it has e.g. various other stuff like @CEntryPoint(name = "j_run_transform")
or @CEntryPoint(name = "j_run_query", exceptionHandler = SaxonCExceptionLongHandler.class)
.
But a search for j_run_validate
doesn't turn up anything. Houston, we have a problem, a command's implementation got missing.
Updated by O'Neil Delpratt almost 2 years ago
- Status changed from New to In Progress
Thanks for filing this bug issue. The j_run_validate
method lives in the com.saxonica
code base. But looking at the code closely shows that it is actually broken.
Updated by O'Neil Delpratt almost 2 years ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
I have managed to fix this issue and tested that we get output. Committed and available for the next maintenance release.
Updated by O'Neil Delpratt over 1 year ago
- Status changed from Resolved to Closed
- Fixed in version set to 12.2
Bug fix applied in the SaxonC 12.2 maintenance release.
Please register to edit this issue