Bug #5664
closed
NullPointerException running validate with incorrect arguments
Applies to branch:
11, trunk
Fix Committed on Branch:
11, trunk
Fixed in Maintenance Release:
Description
Running com.saxonica.Validate on the command line with options
-u http://api.kle-online.dk/resources/kle/emneplan -t
fails with a NullPointerException
I'm hitting a number of issues trying to run this.
(A) It ought to be possible to specify
com.saxonica.Validate -u http://some.domain/source,xml
supplying the source document to be validated positionally. But this is failing with an NPE. We attempt to resolve the URI using the catalog URI resolver, which returns null, and then we don't make a further attempt using the direct resolver. Fixed this (Validate.java line 604).
If I instead try to supply the source document using -s:http://some.domain/source,xml then (on Mac) it tries to treat this as a colon-separated list of source documents (colon being the platform delimiter for filenames. I think that when -u is specified, we should assume the parameter is a single URI, not a list.
First step: for both the source document and schema document, if -u is specified or if the name given is an "implicit URI" (starts with http:. https:, or file:), then the request to resolve the URI includes the DirectResourceResolver as well as the catalog resource resolver. This allows a schema document or source document specified positionally to be resolved.
Second change: if -u is specified with -s, then the list of URIs in the -s option is space-separated rather than colon or semicolon separated (if more than one appears, the list will have to be in quotes).
Third change: currently the names in the -xsd option must be separated by semicolons (regardless of platform). Change this to use the same logic as the -s option: semicolon on Windows, colon on Mac and Linux, whitespace if -u is specified.
For compatibility, because the current code here is working as described in the documentation, make this change only on the 12.x branch.
- Status changed from New to Resolved
- Applies to branch 11, trunk added
- Fix Committed on Branch 11, trunk added
- Platforms .NET, Java added
User documentation updated.
- % Done changed from 0 to 100
- Fixed in Maintenance Release 12.0 added
Bug issue fix applied in the Saxon 12.0 Major Release.
Leaving this bug marked as Resolved until fix applied
- Fixed in Maintenance Release 11.5 added
Bug applied in the Saxon 11.5 Maintenance release.
- Status changed from Resolved to Closed
Please register to edit this issue
Also available in: Atom
PDF