Actions
Bug #4366
closedReturning string of Maps in XQuery failing
Start date:
2019-10-29
Due date:
% Done:
100%
Estimated time:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Found in version:
1.2.1
Fixed in version:
11.1
SaxonC Languages:
SaxonC Platforms:
SaxonC Architecture:
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
Please register to edit this issue
Actions