Project

Profile

Help

Bug #6439

closed

AttributeError: 'saxonche.PyXdmFunctionItem' object has no attribute 'as_list'

Added by O'Neil Delpratt 5 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Low
Category:
Python API
Start date:
2024-05-24
Due date:
% Done:

100%

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

Description

In the python script:

from saxonche import PySaxonProcessor

with PySaxonProcessor() as processor:
    xpath_processor = processor.new_xpath_processor()

    xpath_result = xpath_processor.evaluate_single('array { 1 to 5 }')

    print(type(xpath_result))

    array_as_list = [item.head.get_atomic_value() for item in xpath_result.as_list()]

    print(array_as_list)

The xpath_result should be of type PyXdmArray but the evaluate_single method is failing the correct conversion.


Related issues

Copied from SaxonC - Bug #6437: PyXdmValue of size 1 where the item is an XDM array returns that item as a PyXdmFunctionItem and calling get_array_value() on that item gives error AttributeError: 'saxonche.PyXdmArray' object has no attribute 'derivednptr'ClosedO'Neil Delpratt2024-05-23

Actions
Actions #1

Updated by O'Neil Delpratt 5 months ago

  • Copied from Bug #6437: PyXdmValue of size 1 where the item is an XDM array returns that item as a PyXdmFunctionItem and calling get_array_value() on that item gives error AttributeError: 'saxonche.PyXdmArray' object has no attribute 'derivednptr' added
Actions #2

Updated by O'Neil Delpratt 5 months ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Bug fixed in the Python extension. Problem found in the enumeration values for XdmType.

Actions #3

Updated by O'Neil Delpratt 4 months ago

  • Status changed from Resolved to Closed
  • Fixed in version set to 12.5

Bug fix applied in the Saxon 12.5 Maintenance release.

Actions #4

Updated by Community Admin 4 months ago

  • Fix Committed on Branch 12 added

Please register to edit this issue

Also available in: Atom PDF