Dear Arkadiusz,
I have improved argument parsing for the fn:serialize function. Your code snippet from Priscilla’s great reference book will be successfully evaluated with the latest stable snapshot of BaseX [1].
Dziękuję & cześć, Christian
[1] http://files.basex.org/releases/latest/
On Fri, Apr 3, 2020 at 6:51 PM Arkadiusz Bok arkadiusz_bok@o2.pl wrote:
Hi, I'm trying to run one of unchanged code example from book "XQuery: Search Across a Variety of XML Data 2nd Edition" from publisher O'Reilly Media.
(: XQuery by Priscilla Walmsley (c) 2016 Priscilla Walmsley:)
(:Example 13-4 Serialization parameters in a map :) xquery version "3.1"; declare namespace prod = "http://datypic.com/prod"; let $map := map { "method": "xml", "version": "1.0", "indent": true(), "cdata-section-elements": (xs:QName("prod:desc"),xs:QName("prod:name")), "use-character-maps": map { "«":"<%", "»":">%" } } let $element := prod:nameFleece Pullover</prod:name> return serialize($element,$map)
I'm using BaseX 9.3.2 to do this. But when I'm trying to run code, I get error:
Stopped at C:/Users/Arek/AppData/Local/Temp/example1304.xqy, 16/17: [SEPM0017] item() expected, xs:QName+ found: (Q{http://datypic.com/prod%7Ddesc, Q{http://datypic.com/prod%7Dname).
When i remove 9 line with cdata-section-elements element, code runs. Whether is it problem with XQuery implementation or with code?