validate:xsd() questions
Monday, 11 March 2024 · 2 messages
MG
Murray, Gregory11 Mar 2024 14:41 #
Hello,
What is the default value of the “cache” option for the
validate:xsd() function? The default doesn’t seem to be indicated in the documentation for that function.
Also, the following code raises an error message saying “Item expected, empty sequence found” but that seems odd since the second argument to validate:xsd() is supposed to be optional, thereby telling the validation process to fall back to using the schema indicated in the document itself.let $options := map {'cache' : true()}
for $doc in collection()
return validate:xsd($doc, (), $options)Is this a bug or have I misunderstood something?
Thanks,
Greg
Gregory Murray
Director of Digital Initiatives
Wright Library
Princeton Theological Seminary
CG
Christian Grün11 Mar 2024 18:18 #
Hi Greg,
A helpful observation. With XQuery 4, parameters can directly be addressed by their name, and optional arguments can be omitted:
validate:xsd($doc, options := $options)The changes that were required to make this work led to a bug that is now fixed in the latest snapshot [1].
Thanks,
Christian
[1] https://files.basex.org/releases/latest/
Quoted text · Gregory · 51 lines
On Mon, Mar 11, 2024 at 2:42 PM Murray, Gregory <gregory.murray at ptsem.edu> wrote: > Hello, > > > > What is the default value of the “cache” option for the validate:xsd() > function? The default doesn’t seem to be indicated in the documentation for > that function. > > > > Also, the following code raises an error message saying “Item expected, > empty sequence found” but that seems odd since the second argument to > validate:xsd() is supposed to be optional, thereby telling the validation > process to fall back to using the schema indicated in the document itself. > > > > let $options := map {'cache' : true()} > > for $doc in collection() > > return validate:xsd($doc, (), $options) > > > > Is this a bug or have I misunderstood something? > > > > Thanks, > > Greg > > > > > > Gregory Murray > > Director of Digital Initiatives > > Wright Library > > Princeton Theological Seminary > > > > >
Written for BaseX 10.7. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery