On 05/14/2010 01:26 PM, Bob Wyman wrote:
James Snell <[email protected] <mailto:[email protected]>> wrote:
> <link href="foo" md5="abc...xyz">
> <media:hash algo="GOST">123...456</media:hash>
> </link>
The alternative approach, which would support both a variety
and multiplicity of hashes would look like this:
<link href="foo" hash="gost:123123..., md5:0928402948...,
sha256:098078097..."/>
Given that XML already provides a syntax for key-value pairs, it seems
strange to define a microsyntax for key-value pairs within one of the
values.
I'd expect that most implementations are going to support only one or
two hash algorithms, and it is simpler for them (assuming the usual
approaches for processing XML) to simply look for the one or two
attributes representing the hash algorithms they understand than to
implement a parser for this microsyntax for the ones they are interested in.
I'd expect that only debugging tools and validators will ever be
interested in enumerating *all* of the available hashes, so it's not
crucial that the hashes be distinguishable from other attributes in the
sense that you can determine which attributes are hashes and which are
not without retaining a list of all hash algorithms.