Project

Profile

Help

Feature #3809

closed

Serialization options ignored for XQuery update when using put

Added by Adrian Buza almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XQuery Update
Sprint/Milestone:
-
Start date:
2018-06-05
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
trunk
Fix Committed on Branch:
trunk
Fixed in Maintenance Release:
Platforms:

Description

We have an Oxygen user reporting this issue against Saxon 9.8.0.8 from within Oxygen v20.0.

When using put, serialization options seem to be ignored. I can also reproduce this in the command line with 9.8.0.11 and within Oxygen v20.1 with 9.8.0.12.

test.xquery

xquery version "3.1";

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

declare option saxon:output "indent=yes";
declare option saxon:output "saxon:indent-spaces=4";
declare option output:method "xml";
declare option output:version "1.0";
declare option output:indent "yes";

let $xml :=
    <root>
    {
        (: generates a child element hierarchy here :)
        <test>
        <a>text
        </a>
        </test>
    }
    </root>
   
(:return ($xml):)
return (
    put( $xml, "MyFile.xml"))

In the command line I am running:

java -cp saxon9ee.jar net.sf.saxon.Query -t -backup:off -update:on -q:test.xquery

Result in MyFile.xml is:

<?xml version="1.0" encoding="UTF-8"?><root><test><a>text
        </a></test></root>

Expected result is:

<?xml version="1.0" encoding="UTF-8"?>
<root>
    <test>
        <a>text
        </a>
    </test>
</root>

PS: Could be related to https://saxonica.plan.io/issues/3708

Please register to edit this issue

Also available in: Atom PDF