module namespace test-extra-spaces = "http://www.architextus.com/xquery/library/debug-tests/test-extra-spaces"; declare namespace rest="http://exquery.org/ns/restxq"; declare option db:chop 'no'; declare %rest:path("/test-extra-spaces/test-1") %rest:GET updating function test-extra-spaces:test(){ let $original :=

I love flowers ().

I love flowers: .

let $specify := red, yellow and white ones let $new := copy $copy := $original modify(for $prompt in $copy//specify return replace node $prompt with $specify) return $copy (:Note: database was create with chop white spaces turned 'off':) return (db:replace('test', 'test.xml', $new), db:output({$new})) };