Project

Profile

Help

Bug #2386

closed

Validation errors missing column number

Added by Michael Kay over 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Diagnostics
Sprint/Milestone:
Start date:
2015-05-30
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.6
Fix Committed on Branch:
9.6
Fixed in Maintenance Release:
Platforms:

Description

In some cases (unspecified) validation of a source document against a schema produces validation error messages with a line number but no column number identifying the location of the error.

Actions #1

Updated by Michael Kay over 9 years ago

In some cases (unspecified) the following change to ExpressionLocation.getSourceLocator() fixes the problem:

public static SourceLocator getSourceLocator(int locationId, LocationProvider locationProvider) {
        if (locationProvider instanceof SourceLocator) {
            // this is typically true when validating input documents
            return (SourceLocator) locationProvider;
        } else if (locationId == -1) {
            return null;
        } else {
            ExpressionLocation loc = new ExpressionLocation();
            loc.setLineNumber(locationProvider.getLineNumber(locationId));
            // following line added...
            loc.setColumnNumber(locationProvider.getColumnNumber(locationId));
            loc.setSystemId(locationProvider.getSystemId(locationId));
            return loc;
        }
    }

The change has been applied to 9.7 but needs more testing before applying it to 9.6.

Actions #2

Updated by Michael Kay over 9 years ago

  • Status changed from New to Resolved
  • Found in version set to 9.6

The above change adds column numbers to the error messages for a straightforward command-line validation run, so I have committed it on the 9.6 branch.

Actions #3

Updated by O'Neil Delpratt over 9 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in version set to 9.6.0.6

Bug fix applied in the Saxon 9.6.0.6 maintenance release.

Actions #4

Updated by O'Neil Delpratt over 9 years ago

  • Status changed from Closed to In Progress
  • Fixed in version deleted (9.6.0.6)

I am reopening this bug issue as the problem still exists on .NET.

Actions #5

Updated by O'Neil Delpratt over 9 years ago

  • Status changed from In Progress to Closed
  • Fixed in version set to 9.6.0.6

False alarm. Confirmed bug fixed in the maintenance release for .NET

Actions #6

Updated by O'Neil Delpratt almost 9 years ago

  • Sprint/Milestone set to 9.6.0.6
  • Applies to branch 9.6 added
  • Fix Committed on Branch 9.6 added
  • Fixed in Maintenance Release 9.6.0.6 added

Please register to edit this issue

Also available in: Atom PDF