Re: Request for review: XOP

At 9:20 PM -0700 5/2/04, Mark Nottingham wrote:
>On May 1, 2004, at 2:09 AM, Elliotte Rusty Harold wrote:
>XML allows base64-encoded content; indeed, this is a practice that 
>is encouraged by other recommendation-level W3C specifications. Is 
>it too difficult to believe that people creating or consuming 
>documents containing such content might actually want to work with 
>the binary data instead of its encoded form? I would think that use 
>cases for such data that explicitly focus on the encoded form are by 
>far in the minority (Digital Signature is the only significant one 
>that comes to mind immediately).

XML can contain data in many forms including (but far from limited 
to) integers, floating point numbers, decimals, dates, quoted 
printable, structs, e-mail addresses, URLs, URIs, URNs,  ISBN 
numbers, phone numbers, hex encoded data, and many, many more. Should 
we add methods to interpret all of these things to DOM? Of course not.

Base-64 is no different. It is simply one thing that may appear in an 
XML document, but it has no special status within XML. DOM should 
focus on XML, not on a 1000 different things that may be encoded in 
XML. Higher level applications built on top of DOM may choose to 
decode the Base-64 data or not as suits their needs. However, adding 
special purpose convenience methods that serve only a small fraction 
of the user community primarily serves to complexify an already 
overly complex API. It makes implementation, documentation, and 
learning more difficult, completely out of proportion to the benefit 
achieved.

But most importantly it is conceptually wrong. It confuses XML with 
the data encoded in XML. It presents an incorrect abstraction of an 
XML document. Rather than modelling XML, it models one particular 
interpretation of an XML document. This is not appropriate for an XML 
API.
-- 

   Elliotte Rusty Harold
   elharo@metalab.unc.edu
   Effective XML (Addison-Wesley, 2003)
   http://www.cafeconleche.org/books/effectivexml
   http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA

Received on Monday, 3 May 2004 05:12:44 UTC