Project

Profile

Help

Bug #6333

open

Representing empty sequence

Added by O'Neil Delpratt 11 months ago. Updated 6 months ago.

Status:
In Progress
Priority:
Normal
Category:
Saxon-C Internals
Start date:
2024-01-29
Due date:
% Done:

0%

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

Description

SaxonC currently does not properly represent empty sequences via the API. What we need is an XdmEmptySequence class similar to its Java counterpart. Moreover, In SaxonJ (Java) an empty XdmValue is also an empty sequence which can be passed as a parameter to an expression of stylesheet, but this fails in SaxonC.

For example:

    xp = saxonproc.new_xpath_processor()
    xp.declare_namespace("fn", "http://www.w3.org/2005/xpath-functions")
    xp.declare_variable('p')
    xdm_value = PyXdmValue()
    xp.set_parameter('p', xdm_value)
    assert xp.effective_boolean_value("fn:empty($p)")

Crashes out with the following exception:

java.lang.IllegalArgumentException: Invalid handle
    at com.oracle.svm.core.handles.ObjectHandlesImpl.doGet(ObjectHandlesImpl.java:232)
    at com.oracle.svm.core.handles.ObjectHandlesImpl.get(ObjectHandlesImpl.java:220)
    at net.sf.saxon.option.cpp.ProcessorDataAccumulator.addProcessorDataPair(ProcessorDataAccumulator.java:93)

This is probably because the empty PyXdmValue() object is not internally getting converted to an empty sequence.


Related issues

Related to SaxonC - Bug #6327: TypeError: __str__ returned non-string (type NoneType)ClosedO'Neil Delpratt2024-01-192024-01-19

Actions

Please register to edit this issue

Also available in: Atom PDF