Closed ChristianGruen closed 1 month ago
Generally the specs are a pretty inconsistent mess as regards handling of empty sequence on input; it goes well beyond the parse-XX functions.
In the particular case, it seems that all pre-4.0 functions allow empty sequences, whereas only some of the new functions do. But it’s true, when cleaning this up we should probably consider the complete function set.
See also #748
I was asked why some of the parsing functions allow empty input and others don’t:
fn:parse-integer
xs:string
fn:parse-uri
xs:string
fn:parse-ietf-date
xs:string?
fn:parse-QName
xs:string
fn:parse-xml
xs:string?
fn:parse-xml-fragment
xs:string?
fn:parse-html
(xs:string \| xs:hexBinary \| xs:base64Binary)?
fn:parse-json
xs:string?
fn:parse-csv
xs:string?
I would assume there is no rationale behind this, and that we should always allow empty input.