[Bug 15317] New: absence of functions for reading binary data in XPath 3.0 Working Draft

https://www.w3.org/Bugs/Public/show_bug.cgi?id=15317

           Summary: absence of functions for reading binary data in XPath
                    3.0 Working Draft
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XPath 3.0
        AssignedTo: jonathan.robie@gmail.com
        ReportedBy: mgac23@gmail.com
         QAContact: public-qt-comments@w3.org


This comment is in regard to the current (last call) working draft for XPath
3.0.

What somehow irritates me is the (ongoing) absence of functions for reading
binary data stored in files! 

A function unparsed-text() was introduced with version 2.0 (I guess) for
reading arbitrary text files, but no one has taken this a step further and has
standardized a function for reading binary files in XPath or XSLT. This is
surprising for such powerful and, in the meantime, mature standards.  There are
established encodings for binary data (hex, base64) that allow to embed the
data into any valid XML document, even so there is no function to read any
binary data from a file - does this make sense?

There exist scenarios where it is necessary or even convenient to embed binary
data into XML documents. For example think of the (pre-docx) XML data format of
the Microsoft Word text processor: Images or OLE objects are embedded as
encoded text like that

    <w:docOleData><w:binData w:name="oledata.mso">0M8R4KGxGuEAAAAAAAAAA....

Another example (that we use a lot when generating documentation for software
development projects) is the embedding of CSS icons or images into XHTML
documents: This is done via utilizing data URI schemes in the src attributes of
the XHTML img elements

    <img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy5...

This might not be so elegant, but we have reasons to do so.

Currently, we have to write a Java extension function for the Saxon XSLT engine
for converting the contents of a binary file to a base64 encoded string. A
standard XPath function as replacement would be greatly appreciated!

In short, my appeal: Please add functions for reading binary data files to the
XPath 3.0 standard! For example, they might be called unparsed-binary() or
base64-binary() or hex-binary() or whatever you like !

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Thursday, 22 December 2011 22:05:40 UTC