Project

Profile

Help

Bug #5664

closed

NullPointerException running validate with incorrect arguments

Added by Michael Kay over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Command Line
Sprint/Milestone:
-
Start date:
2022-08-26
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
11, trunk
Fix Committed on Branch:
11, trunk
Fixed in Maintenance Release:
Platforms:
.NET, Java

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

Actions #1

Updated by Michael Kay over 1 year ago

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.

Actions #2

Updated by Michael Kay over 1 year ago

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.

Actions #3

Updated by Michael Kay over 1 year ago

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).

Actions #4

Updated by Michael Kay over 1 year ago

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.

Actions #5

Updated by Michael Kay over 1 year ago

  • 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.

Actions #6

Updated by Community Admin over 1 year ago

  • % 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

Actions #7

Updated by O'Neil Delpratt about 1 year ago

  • Fixed in Maintenance Release 11.5 added

Bug applied in the Saxon 11.5 Maintenance release.

Actions #8

Updated by O'Neil Delpratt about 1 year ago

  • Status changed from Resolved to Closed

Please register to edit this issue

Also available in: Atom PDF