[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Processing binary data using XPath ... wow!

  • From: "Costello, Roger L." <costello@mitre.org>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Mon, 11 Aug 2014 09:33:51 +0000

Processing binary data using XPath ... wow!
Hi Folks,

Are you aware of the ExPath Binary Module? It is awesome:

	The ExPath Binary Module provides an API 
	for XPath 2.0 to handle binary data. 

Wow!

	It defines extension functions to process data 
	from binary files, including extracting subparts, 
	searching, basic binary operations and conversion 
	between binary and structured forms. 

Fantastic!

	It has been designed to be compatible with 
	XQuery 1.0 and XSLT 2.0, as well as any 
	other XPath 2.0 usage.

Standards-based!

A few more exciting facts about processing binary data using XPath:

1. The binary data is converted to base64 text (i.e., the binary is encoded as base64 text). The ExPath Binary Module provides XPath functions for searching and manipulating the binary data in its base64 form.

2. XML documents have always been able to carry base64 data (since base64 is just text). But processing that base64 data was difficult, requiring custom-coding. Now the ExPath Binary Module provides us with standard functions for processing base64 data. Fantastic!

3. There is a companion standard, The ExPath File Module, which contains XPath functions for reading and writing binary files:

	file:read-binary(filename) is an XPath function
	that takes as its argument the name of a binary
	file (e.g., the name of a PDF file) and it returns
	the file as base64 text.

	file:write-binary(filename, base64) is an XPath	
	function that takes as its argument the name of
	a file and base64 text and writes the base64 text
	as binary to the file. 

	file:append-binary(filename, base64) is an XPath	
	function that takes as its argument the name of
	a file and base64 text and appends the base64 text
	as binary to the file.

4. Here are a few examples of things that can be done using the new XPath functions:

	- Get the dimensions of an image file.
	- Extract image metadata.
	- Process images embedded as base64 
	  encodings in an XML document.

5. The 9.6 PE/EE editions of Saxon, which are anticipated to be released in the next few months, will contain complete implementations of ExPath Binary Module and ExPath File Module.

/Roger

Binary Module 1.0 (http://www.w3.org/2013/12/expath-binary-20131203/)

File Module (http://expath.org/spec/file) 




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.