Bug #4416
closeditemAt not downcasting to the lowest class/type in the hierarchy
100%
Description
Reported by user: https://saxonica.plan.io/boards/4/topics/7743
The itemAt method in C++, PHP and Python does not downcast to the lowest class/type in the hierarchy.
Updated by O'Neil Delpratt almost 5 years ago
- Status changed from New to In Progress
I have added code in the Python API to downcast the XdmItem to the minimum type possible. Added test cases.
Updated by O'Neil Delpratt almost 5 years ago
- Status changed from In Progress to Resolved
Updated by Martin Honnen almost 5 years ago
Are the changes that are in https://dev.saxonica.com/repos/archive/opensource/latest9.9/hec/Saxon.C.API/python-saxon/saxonc.pyx the final changes and are tested?
When I use that file I run into cython errors:
Error compiling Cython file:
------------------------------------------------------------
...
"""
cdef PyXdmValue val = None
cdef PyXdmAtomicValue aval = None
cdef PyXdmNode nval = None
cdef PyXdmItem val = None // remove PyXdmItem()
^
------------------------------------------------------------
saxonc.pyx:3348:44: Syntax error in C variable declaration
If I try to fix that error by using cdef PyXdmItem val = None # remove PyXdmItem()
I run into another error:
Error compiling Cython file:
------------------------------------------------------------
...
cdef saxoncClasses.XdmItem * xdmItem = NULL
xdmItem = self.thisvptr.itemAt(index)
if xdmItem == NULL:
return None
else :
cdef type_ = xdmItem.getType()
^
------------------------------------------------------------
saxonc.pyx:3354:17: cdef statement not allowed here
Using Python 3.7 and cython 0.29.14 on Windows 10.
Updated by O'Neil Delpratt almost 5 years ago
- Status changed from Resolved to In Progress
I should not have marked this bug as resolved. I have fixed both issues in comment #3.
These changes are not tested as yet.
Updated by O'Neil Delpratt almost 3 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
- Fixed in version set to 11.1
Testing completed.
Bug fix applied in the Saxon 11.1 maintenance release.
Please register to edit this issue