Project

Profile

Help

Bug #4366

closed

Returning string of Maps in XQuery failing

Added by O'Neil Delpratt over 4 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Saxon-C Internals
Start date:
2019-10-29
Due date:
% Done:

100%

Estimated time:
Found in version:
1.2.1
Fixed in version:
11.1
Platforms:

Description

Reported by user in the forum post: https://saxonica.plan.io/boards/4/topics/7645

Due to the lack of support of XdmFunctionItem objects in Saxon/C it should be possible to execute in XQuery to string a map object but this fails.

The following python script supplied by the user we add to our unit tests for investigation purposes:

import saxonc

with saxonc.PySaxonProcessor(license=False) as proc:
    print(proc.version)

    xquery_processor = proc.new_xquery_processor()

    query = """declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";

declare option output:method 'json';

map { 'prop1' : 'value 1', 'prop2' : 'value 2' }"""

    xquery_processor.set_property("!method", "json")

    result = xquery_processor.run_query_to_string(query_text = query)

    print("string result: ", result)

    result = xquery_processor.run_query_to_value(query_text = query)

    print("value result: ", result)

Outputs:

Saxon/C 1.2.1 running with Saxon-HE 9.9.1.5J from Saxonica
string result:  None
value result:  None

The equivalent works fine in XSLT. When returning a value object this should in fact not be possible. An error message should be reported to the user stating that "FunctionItem found. Currently not be handled"


Related issues

Related to SaxonC - Bug #4365: XdmFunctionItem not supportedClosedO'Neil Delpratt2019-10-29

Actions

Please register to edit this issue

Also available in: Atom PDF