Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing Functions: Empty input #1193

Closed
ChristianGruen opened this issue May 7, 2024 · 3 comments
Closed

Parsing Functions: Empty input #1193

ChristianGruen opened this issue May 7, 2024 · 3 comments
Labels
Editorial Minor typos, wording clarifications, example fixes, etc. XQFO An issue related to Functions and Operators

Comments

@ChristianGruen
Copy link
Contributor

ChristianGruen commented May 7, 2024

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.

@ChristianGruen ChristianGruen added XQFO An issue related to Functions and Operators Editorial Minor typos, wording clarifications, example fixes, etc. labels May 7, 2024
@michaelhkay
Copy link
Contributor

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
Copy link
Contributor Author

ChristianGruen commented May 7, 2024

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
Copy link
Contributor

See also #748

ChristianGruen added a commit to ChristianGruen/qtspecs that referenced this issue May 21, 2024
@ChristianGruen ChristianGruen added the PR Pending A PR has been raised to resolve this issue label May 21, 2024
ChristianGruen added a commit to ChristianGruen/qtspecs that referenced this issue May 28, 2024
@ndw ndw closed this as completed in a0d6e1e Sep 3, 2024
ChristianGruen added a commit to qt4cg/qt4tests that referenced this issue Sep 19, 2024
@ChristianGruen ChristianGruen removed the PR Pending A PR has been raised to resolve this issue label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Editorial Minor typos, wording clarifications, example fixes, etc. XQFO An issue related to Functions and Operators
Projects
None yet
Development

No branches or pull requests

2 participants