Skip to content

file:read-text: allow empty sequence for option encoding - #2771

Merged
ChristianGruen merged 1 commit into
BaseXdb:mainfrom
GuntherRademacher:file-read-options
Sep 29, 2026
Merged

ChristianGruen merged 1 commit into
BaseXdb:mainfrom
GuntherRademacher:file-read-options

Conversation

@GuntherRademacher

Copy link
Copy Markdown
Member

There were two QT4 test failures:

EXPath-file-read-fallback-003
file:read-text("non-xml.txt", { "encoding": (), "fallback": true() })
Error : XPTY0004: Option encoding: xs:string expected, empty-sequence() found: ().
Expect: <assert xmlns="http://www.w3.org/2010/09/qt-fots-catalog">starts-with($result, "U0000=�")</assert>

EXPath-file-read-text-lines-fallback-003
file:read-text-lines("non-xml.txt", { "encoding": (), "fallback": true() })
Error : XPTY0004: Option encoding: xs:string expected, empty-sequence() found: ().
Expect: <assert xmlns="http://www.w3.org/2010/09/qt-fots-catalog">starts-with($result, "U0000=�")</assert>

These were caused by recent changes of those tests, introducing usage of the options parameter. This uncovered the option value not allowing emtpy sequence as a value, which is permitted by the spec.

@ChristianGruen
ChristianGruen merged commit 7e63d21 into BaseXdb:main Sep 29, 2026
1 check passed
@ChristianGruen
ChristianGruen deleted the file-read-options branch September 29, 2026 11:35
@ChristianGruen

Copy link
Copy Markdown
Member

Related: d6c0921

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants