Project

Profile

Help

Bug #6562

closed

Casting XdmValue from parseJson to XdmMap causes casting problems in C++ for mapSize

Added by O'Neil Delpratt 8 days ago. Updated 8 days ago.

Status:
Resolved
Priority:
Normal
Category:
C++ API
Start date:
2024-10-17
Due date:
% Done:

100%

Estimated time:
Applies to branch:
12, trunk
Fix Committed on Branch:
12, trunk
Fixed in Maintenance Release:
Found in version:
Fixed in version:
SaxonC Languages:
All
SaxonC Platforms:
All
SaxonC Architecture:

Description

I noticed some strange casting issue of XdmValue to XdmMap via the parseJsonFromString method.

The map_size variable is corrupted in the class XdmMap.

See example:

XdmValue * signatureValue = parseJsonFromString(signature);
XdmItem * item = signatureValue->getHead();
if(item->isMap()) {
    XdmMap *xdmMap = (XdmMap *) item;
    int size = xdmMap->mapSize(); // problem here
}
Actions #1

Updated by O'Neil Delpratt 8 days ago

  • Description updated (diff)
Actions #2

Updated by O'Neil Delpratt 8 days ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100
  • Fix Committed on Branch 12, trunk added

Bug fixed on the saxon12 and main branches. The XdmMap class has been simplified by removing redundant code.

Also we now create the XdmMap class object from parseJson if the type returned is an Xdm map.

Please register to edit this issue

Also available in: Atom PDF