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

Please register to edit this issue

Also available in: Atom PDF