Method to load and access binary contents stored in XML files by usage of a client web browser
Original Publication Date: 2005-Sep-08
Included in the Prior Art Database: 2005-Sep-08
This article shows a method to access and load binary data stored in XML documents using a web browser client without deploying additional software on the client or supplying a trust certificate.
Method to load and access binary contents stored in XML files by usage of a client Method to load and access binary contents stored in XML files by usage of a clientMethod to load and access binary contents stored in XML files by usage of a client Method to load and access binary contents stored in XML files by usage of a client
web browser web browserweb browser web browser
Storing data in XML format becomes more and more relevant . User friendly and graphically formatted viewing of XML data can be done easily by applying style sheets to the XML provided data.
But style sheets do not offer possibilities to process the contained binary data in a proper way, so that e.g. images could be displayed. This article describes a method to access binary data stored in XML documents and forward it to an application that is intended to handle the data . The access to the binary data uses just a web browser with a built-in XSLT transformator, a style sheet, and a Java Applet. The style sheet and the Java* Applet can be provided by a simple web server. The method does not require to register a trust certificate for the Applet to store data locally. By applying this method it could also be avoided to install additional software on the client, which loads and displays the XML content. The binary content extracted from the XML content can either be loaded directly into a display application or stored locally. These features depend strongly on the capabilities of the web browser used to load the XML data.
The method works in the following way (please refer to figure 1):
The client web browser opens the XML document. The XML document requests the browser to process the data by a style sheet.
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href=".\Sample_Memo_Att.xsl"?>
MCaydY5mzxGm2QCqAGLObLgKAAAAAAAACAAAAAECMyaydY5mzxGm2QCqAGLObH4AAAAA AAAADgAE ..........
The style sheet transforms the data from XML to HTML .
If the XML file contains a binary data element the transformation converts this to HTML code that loads an Applet and passes the BLOB data of the XML file to the Applet.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<body bgcolor="#ffffff" marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
<param name="filename"><xsl:attribute name="value"><xsl:value-of select="file/@name"/></xsl:attribute></param> <param name="bufferVal"><xsl:attribute name="value"><xsl:value-of select="file/filedata"/></xsl:attribute></param> </applet>