Project

Profile

Help

Bug #5805

closed

Set locator to XmlProcessingIncident

Added by Radu Coravu over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Diagnostics
Sprint/Milestone:
-
Start date:
2023-01-11
Due date:
% Done:

100%

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

Description

Let' say in my XSLT I made a silly mistake and used xsl:attributes instead of xsl:attribute.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:p="http://www.oxygenxml.com/ns/samples/personal"
    exclude-result-prefixes="p">
    <xsl:template match="/">
            <xsl:element name="table">
                <xsl:attributes name="border">1</xsl:attributes>
            </xsl:element>
    </xsl:template>
</xsl:stylesheet>

I create a transformer which fails with the error "Unknown XSLT instruction xsl:attributes" but there is no location for it, its line is -1.

I suggest here: net.sf.saxon.style.StyleElement.setValidationError(XmlProcessingIncident, OnFailure) to add some extra code:

        if(reason != null && reason.getLocation() == Loc.NONE) {
            reason.setLocation(allocateLocation());
        }
Actions #1

Updated by Michael Kay over 1 year ago

Seems to be already fixed in 12.0.

Actions #2

Updated by Michael Kay over 1 year ago

  • Category set to Diagnostics
  • Status changed from New to Resolved
  • Assignee set to Michael Kay
  • Priority changed from Low to Normal
  • Applies to branch 11, 12, trunk added
  • Fix Committed on Branch 11, 12, trunk added
  • Platforms .NET, Java added

I made minor tweaks to the 12.0 diagnostics as well.

Actions #3

Updated by O'Neil Delpratt about 1 year ago

  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 11.5 added

Bug fix applied in the Saxon 11.5 maintenance release.

Actions #4

Updated by O'Neil Delpratt about 1 year ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release 12.1 added

Bug fix applied in the Saxon 12.1 maintenance release.

Please register to edit this issue

Also available in: Atom PDF