setProperty and setParameter does not replace keys already in the map
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.
Updated by O'Neil Delpratt almost 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.
Please register to edit this issue