https://saxonica.plan.io/https://saxonica.plan.io/favicon.ico2020-01-14T17:09:22ZSaxonica Developer CommunitySaxonC - Bug #4416: itemAt not downcasting to the lowest class/type in the hierarchyhttps://saxonica.plan.io/issues/4416?journal_id=147162020-01-14T17:09:22ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li></ul><p>I have added code in the Python API to downcast the XdmItem to the minimum type possible. Added test cases.</p> SaxonC - Bug #4416: itemAt not downcasting to the lowest class/type in the hierarchyhttps://saxonica.plan.io/issues/4416?journal_id=147172020-01-14T17:32:18ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Resolved</i></li></ul> SaxonC - Bug #4416: itemAt not downcasting to the lowest class/type in the hierarchyhttps://saxonica.plan.io/issues/4416?journal_id=147232020-01-15T12:32:54ZMartin Honnenmartin.honnen@gmx.de
<ul></ul><p>Are the changes that are in <a href="https://dev.saxonica.com/repos/archive/opensource/latest9.9/hec/Saxon.C.API/python-saxon/saxonc.pyx" class="external">https://dev.saxonica.com/repos/archive/opensource/latest9.9/hec/Saxon.C.API/python-saxon/saxonc.pyx</a> the final changes and are tested?</p>
<p>When I use that file I run into cython errors:</p>
<pre><code>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
</code></pre>
<p>If I try to fix that error by using <code>cdef PyXdmItem val = None # remove PyXdmItem()</code> I run into another error:</p>
<pre><code>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
</code></pre>
<p>Using Python 3.7 and cython 0.29.14 on Windows 10.</p> SaxonC - Bug #4416: itemAt not downcasting to the lowest class/type in the hierarchyhttps://saxonica.plan.io/issues/4416?journal_id=147242020-01-15T12:57:27ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>In Progress</i></li></ul><p>I should not have marked this bug as resolved. I have fixed both issues in comment #3.</p>
<p>These changes are not tested as yet.</p> SaxonC - Bug #4416: itemAt not downcasting to the lowest class/type in the hierarchyhttps://saxonica.plan.io/issues/4416?journal_id=199652022-03-12T02:29:27ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li><li><strong>Fixed in version</strong> set to <i>11.1</i></li></ul><p>Testing completed.</p>
<p>Bug fix applied in the Saxon 11.1 maintenance release.</p>