qt4cg / qtspecs

QT4 specifications
https://qt4cg.org/
Other
28 stars 15 forks source link

Parsing Functions: Empty input #1193

Closed ChristianGruen closed 1 month ago

ChristianGruen commented 5 months ago

I was asked why some of the parsing functions allow empty input and others don’t:

Function Input
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.

michaelhkay commented 5 months 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.

ChristianGruen commented 4 months ago

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.

michaelhkay commented 4 months ago

See also #748