Project

Profile

Help

Bug #5691

open

Appending a node discards any location that it might have had

Added by Norm Tovey-Walsh 3 months ago. Updated 3 months ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
2022-09-19
Due date:
% Done:

0%

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

Description

Outputter.append() is:

    @Override
    public void append(Item item) throws XPathException {
        append(item, Loc.NONE, ReceiverOption.ALL_NAMESPACES);
    }

That means any item you append loses its location. I have some code that copies a tree, selectively modifying parts of it. I assumed that if I reached a node that I wasn't going to modify, I could simply call append() with node.getUnderlyingNode(). But if I do that, then the location is lost and consequently the base URI of the copied node(s) is lost.

I can work around this by doing the recursive descent and output the nodes encountered. But that seems like unnecessary work.


Files

iss5691.zip (82.3 KB) iss5691.zip Norm Tovey-Walsh, 2022-09-20 10:57

Please register to edit this issue

Also available in: Atom PDF