Bug #4229
closed
The saxon:system-id() function does not return the correct systemID when the documents contains xi:include
Category:
Saxon extensions
Applies to branch:
9.8, 9.9, trunk
Fix Committed on Branch:
9.8, 9.9, trunk
Fixed in Maintenance Release:
Description
It seems that the saxon:system-id() function does not return the correct systemID when you have a document that contains xi:include.
For example if I apply the "printSysID.xsl" stylesheet on the "refentry2.xml", for the "@remap" attribute from the "refentry2.xml" file it returns "file:/.../para.xml" systemId in some cases.
I tested with Saxon 9.9.1.2 and Saxon 9.8.0.12 PE and EE
Files
The problem is that TinyAttributeImpl does not implement the method getSystemId(), so it is defaulting to the implementation in TinyNodeImpl.getSystemId(), which is incorrect for attribute nodes because it uses an attribute node number to index into the table of system IDs, when this table is indexed by element node numbers.
Therefore the system ID returned for attribute nodes (in a tinyTree) is incorrect.
Fix by adding to TinyAttributeImpl:
@Override
public String getSystemId() {
NodeInfo parent = getParent();
return parent == null ? null : getParent().getSystemId();
}
Workaround: use ../saxon:system-id()
.
- Category set to Saxon extensions
- Status changed from New to Resolved
- Assignee set to Michael Kay
- Applies to branch 9.9, trunk added
- Fix Committed on Branch 9.9, trunk added
- Applies to branch 9.8 added
- Fix Committed on Branch 9.8 added
- % Done changed from 0 to 100
- Fixed in Maintenance Release 9.9.1.4 added
Bug fix applied in the Saxon 9.9.1.4 maintenance release.
- Status changed from Resolved to Closed
- Fixed in Maintenance Release 9.9.1.5 added
- Fixed in Maintenance Release deleted (
9.9.1.4)
Bug fix applied in the Saxon 9.9.1.5 maintenance release.
Please register to edit this issue
Also available in: Atom
PDF