Project

Profile

Help

Bug #6063

closed

Incorrect attribute indentation

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

Status:
Closed
Priority:
Normal
Assignee:
Category:
Serialization
Sprint/Milestone:
-
Start date:
2023-06-05
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

The number of spaces output before an indented attribute is one too many. We are seeing, for example

<isee:ISEE-Event xmlns="http://www.example.com/schemas/ex/5.00"
__________________xmlns:isee="http://www.w3.org/2001/XMLSchema-instance/isee"
__________________xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
__________________schemaVersion="5.00">

with 18 spaces rather than 17 on lines 2, 3, and 4.

Problem was raised on StackOverflow, see https://stackoverflow.com/questions/76405207/saxon-he-9-x-11-x-12-x-indentation-differences-depending-on-operating-system/76408103#76408103

and subsequent discussion.

Actions #1

Updated by Michael Kay over 1 year ago

  • Description updated (diff)
Actions #2

Updated by Michael Kay over 1 year ago

  • Status changed from New to Resolved
  • Fix Committed on Branch 11, 12, trunk added
Actions #3

Updated by Michael Kay over 1 year ago

Changed XMLIndenter.startElement() from

             if (len > getLineLength()) {
                int indent = (level - 1) * getIndentation() + 3;
                emitter.setIndentForNextAttribute(indent);
            }

to

            if (len > getLineLength()) {
                int indent = (level - 1) * getIndentation() + 2;
                emitter.setIndentForNextAttribute(indent);
            }
Actions #4

Updated by Michael Kay over 1 year ago

Note, I have not investigated the suggestion that this varies by operating system. It seems too implausible; it seems highly likely that the user was running different Saxon versions on the different platforms.

Actions #5

Updated by O'Neil Delpratt over 1 year ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 12.3 added

Bug fix applied in the Saxon 12.3 maintenance release.

Actions #6

Updated by O'Neil Delpratt over 1 year ago

  • Status changed from Closed to Resolved

Leaving this bug issue as resolved until resolved against Saxon 11.

Actions #7

Updated by Debbie Lockett over 1 year ago

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

Bug fix applied in the Saxon 11.6 maintenance release.

Please register to edit this issue

Also available in: Atom PDF