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

fn:unparsed-binary: accessing and manipulating binary types #557

Closed
birodb opened this issue Jun 17, 2023 · 8 comments
Closed

fn:unparsed-binary: accessing and manipulating binary types #557

birodb opened this issue Jun 17, 2023 · 8 comments
Labels
Feature A change that introduces a new feature XQFO An issue related to Functions and Operators

Comments

@birodb
Copy link
Contributor

birodb commented Jun 17, 2023

Dear All,
When working with binary types currently one has to fall back to string conversions and/or extensions.
A few ideas on nice to have functions that operate on binary types:
-accessing a single byte at a specific position
-splitting binary data at byte boundary (aka binary-subsequence)
-converting to/from a sequence of byte(s)
-joining binary data together
-(optionally) loading data directly as (base64)binary (some extensions are using unparsed-text with proprietary decoding 'x-binarytobase64' to retrieve a base64 castable string)
-standard bit-wise operators and, or, xor, not, rshift, lshift

If considered, then each needs to be discussed in detail separately -ex. which type to support signed/unsigned, 8 bit etc.-, I merely intend as conversation starter in case others encountered similar issues/limitations.

p.s.: Not sure if this is the right channel to raise this issue, so feel free to close/move/split accordingly.

@michaelhkay
Copy link
Contributor

These features are all in the EXPath binary module -- see http://expath.org/modules/binary/ -- which I think is supported in those products that are implementing the 4.0 specifications. We could consider integrating this module into the main specifications, but I'm not sure whether the editorial effort in doing so would achieve any practical benefits. Other than, perhaps, making the specs more visible to people who haven't come across them!

@michaelhkay
Copy link
Contributor

One think we perhaps do need to add, I think, is a function to read a binary resource. That's currently available in the EXPath file module, but we certainly don't want to bring in the whole of the file module because many of the functions have side-effects and it's therefore very difficult to define clean semantics for them.

@birodb
Copy link
Contributor Author

birodb commented Jun 17, 2023

Thank you very much, it's a fair point. I think adding a direct link to the EXPath binary module (maybe even as optional feature) will improve the visibility sufficiently - it definitely slipped under my radar, it's been a relatively long time since I've last looked at those modules.

@ChristianGruen ChristianGruen added Discussion A discussion on a general topic. XQFO An issue related to Functions and Operators Editorial Minor typos, wording clarifications, example fixes, etc. labels Jun 20, 2023
@ChristianGruen ChristianGruen changed the title FO (feature request) accessing and manipulating binary types fn:unparsed-binary: accessing and manipulating binary types Oct 17, 2023
@ChristianGruen
Copy link
Contributor

One think we perhaps do need to add, I think, is a function to read a binary resource.

I’ve updated the title of the issue to reflect this requirement (whatever the name will be called).

As indicated in #748 (comment), we should clarify if this function can be nondeterministic.

@ChristianGruen ChristianGruen added Enhancement A change or improvement to an existing feature Feature A change that introduces a new feature and removed Editorial Minor typos, wording clarifications, example fixes, etc. Discussion A discussion on a general topic. Enhancement A change or improvement to an existing feature labels Oct 17, 2023
@ChristianGruen ChristianGruen added the Propose for V4.0 The WG should consider this item critical to 4.0 label Nov 15, 2023
@ChristianGruen
Copy link
Contributor

I‘ve added the »Propose for V4.0« label: Function such as fn:parse-html are able to process xs:base64Binary, and others might follow (see #748), so we should have a function for generating such data (apart from xs:base64Binary(...)).

@Arithmeticus
Copy link
Contributor

Some related discussion at #414 , concerning detecting availability of a binary resource, and getting it.

@ndw
Copy link
Contributor

ndw commented Jun 4, 2024

The issues discussed here are also discussed in #1127 which appears to superscede this one.

@ndw ndw added the Propose Closing with No Action The WG should consider closing this issue with no action label Jun 4, 2024
@ndw
Copy link
Contributor

ndw commented Jun 11, 2024

The CG agreed to close this issue without further action at meeting 081

@ndw ndw closed this as completed Jun 11, 2024
@michaelhkay michaelhkay removed Propose Closing with No Action The WG should consider closing this issue with no action Propose for V4.0 The WG should consider this item critical to 4.0 labels Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature A change that introduces a new feature XQFO An issue related to Functions and Operators
Projects
None yet
Development

No branches or pull requests

5 participants