Project

Profile

Help

Bug #4071

closed

Copying of line numbers

Added by Michael Kay over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Saxon extensions
Sprint/Milestone:
-
Start date:
2018-12-14
Due date:
% Done:

100%

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

Description

By default, if source documents have line numbers maintained, then the xsl:copy-of instruction copies the line number information across to the target document. This operation is expensive, and it seems it is often done when not required.

In some cases it involves copying the base URI of nodes in the source document, and this is particularly expensive because it involves looking for xml:base attributes.

The internal logic supporting CopyOf is used in many cases other than an explicit xsl:copy-of instruction in XSLT. It's used, for example, for the implicit copying done in XQuery.

Its difficult now to recall the use cases that led to this being done, and there's a risk that changing it may break something. However, I think there are some changes we should make:

(a) If CopyOf.setCopyLineNumbers() is not called, then (despite what the Javadoc says) the default is COPY: even if line numbering isn't switched on for the configuration or for the particular source document. I think the code should change to match the documentation. There may then be paths where we need to set the value to maintain current behaviour.

(b) For a copy controlled explicitly using xsl:copy-of, I think the default should be NO-COPY; perhaps we need an extension attribute to change this, but I'm not convinced.

Please register to edit this issue

Also available in: Atom PDF