Project

Profile

Help

Bug #6054

closed

NamedNodeMap.getNamedItem throw UnsupportedOperationException

Added by Khalil Rahmouni over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
DOM Interface
Sprint/Milestone:
-
Start date:
2023-05-30
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:
Java

Description

i use the following Code to extract the value of an attribute, it works fine with version 9.9 but with version 11.5 it throw an exception : UnsupportedOperationException: NodePredicate doesn't support this method.

EnterpriseConfiguration config = new EnterpriseConfiguration();

        NodeInfo rootNode = config.buildDocumentTree(new StreamSource(resourceAsStream)).getRootNode();
        Document document = (Document) DocumentOverNodeInfo.wrap(rootNode);

        Element documentElement1 = document.getDocumentElement();
        NamedNodeMap attributes1 = documentElement1.getAttributes();
        Node namedItem1 = attributes1.getNamedItem("xsi:schemaLocation"); 

Files

valid_baseProduct.xml (1.38 KB) valid_baseProduct.xml Khalil Rahmouni, 2023-05-30 15:40
Actions #1

Updated by Michael Kay over 1 year ago

  • Category set to DOM Interface
  • Status changed from New to In Progress
  • Assignee set to Michael Kay
  • Priority changed from Low to Normal

Thanks for reporting it. Reproduced as JUnit test DOMTest.testBug6054.

Actions #2

Updated by Michael Kay over 1 year ago

Now fixed. I have to confess the DOM-over-Saxon node wrapper (NodeOverNodeInfo) doesn't have very good test coverage. It was changed a little to adapt to interface changes introduced for C# transpilation, and it looks like this particular path wasn't covered by regression tests. This is one of the few places we try to find an attribute by its lexical QName rather than its namespace URI plus local name, a consequence of DOM not being fully namespace-aware.

Actions #3

Updated by Michael Kay over 1 year ago

  • Status changed from In Progress to Resolved
  • Applies to branch 12, trunk added
  • Fix Committed on Branch 11, 12, trunk added
Actions #4

Updated by Khalil Rahmouni over 1 year ago

i downloaded saxon 11.5 ee again, but i still get the same error , does the download jar contains the fix already?

Actions #5

Updated by Michael Kay over 1 year ago

No, sorry, "resolved" means that we have applied and tested a fix. When we issue a maintenance release containing the fix, we'll update the status of the issue to indicate this. (If you're really keen you can build the Saxon-HE product yourself from the source code repository, but it's not something for the faint-hearted).

Actions #6

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 #7

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 #8

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