Project

Profile

Help

Bug #4386

closed

setProperty and setParameter does not replace keys already in the map

Added by O'Neil Delpratt over 4 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Category:
C++ API
Start date:
2019-11-15
Due date:
% Done:

100%

Estimated time:
Found in version:
1.2.1
Fixed in version:
11.1
Platforms:

Description

Reported in the forum post: https://saxonica.plan.io/boards/4/topics/7680

Across all the processors when we use the setProperty and setParameter methods if a key already exists in the properties or parameters map the value of the key is not updated with the new value.

A workaround would be to call clearProperties() and clearParameters() before updating new values. There is also a removeParameter method which can be used before the new parameter is updated/added.


Related issues

Related to SaxonC - Bug #5533: segfault when setting xslt parameter in a loopClosedO'Neil Delpratt2022-05-23

Actions
Actions #1

Updated by O'Neil Delpratt over 4 years ago

In the C++ API we use the map::insert method to add key, value pairs. However the the API documentation for the insert method states:

Because element keys in a map are unique, the insertion operation checks whether each inserted 
element has a key equivalent to the one of an element already in the container, and if so, 
the element is not inserted, returning an iterator to this existing element (if the function returns a value).

Therefore using the insert method will not work if the key exists already.

Actions #2

Updated by O'Neil Delpratt over 4 years ago

  • Status changed from New to Resolved

Bug fixed and added C++ test cases.

Actions #3

Updated by O'Neil Delpratt about 2 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in version set to 11.1

Bug fix patched in SaxonC 11.1 release

Actions #4

Updated by O'Neil Delpratt almost 2 years ago

  • Related to Bug #5533: segfault when setting xslt parameter in a loop added

Please register to edit this issue

Also available in: Atom PDF