Data Encoding Vocabulary

I think it would be very useful in the following cases to have a vocabulary
element that we can use to encode non-XML data:

   * when the result of an XSLT transform is 'html', 'text' or some non-XML
     media type.
   * to allow image data to be passed within a pipeline
   * to support encrypted data.

We could a simple element in a namespace of our choosing like:

<c:data type="mime-type">data...</c:data>

The rules would be:

   * any 'text/*' mime type would be allowed to be embedded as escaped
     text children.
  * all other mime types must be base64 encoded data.

The base64 encoding is consistent with XMLSchema's base64Binary
simple type.

For example, if a transformation has 'text' as its output method, the
encoding would be:

<c:data type="text/plain">
class foo { .... }
</c:data>

Similarly, you could produce a binary from a step by using:

<c:data type="image/jpeg">...base64...</c:data>

The nice thing about this is we can re-use this solution for allowing the
full range of results from XSLT as well as encryption and other
steps results that might required the "root" of the result to be non-XML.

-- 
--Alex Milowski
"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language
considered."

Bertrand Russell in a footnote of Principles of Mathematics

Received on Wednesday, 31 January 2007 17:31:06 UTC