axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Daniels <gdani...@macromedia.com>
Subject Caching a message byte-for-byte
Date Wed, 13 Jun 2001 14:28:11 GMT

I just want to codify and confirm some discussion which happened on IRC
yesterday.

Storing a message as a series of SAX events will NOT be able to generate
exactly the same sequence of bytes which originally constitued the message.
In particular, consider:

<element xmlns:ns1="url1" attr1="val"     xmlns:ns2="url2"/>

Because SAX splits out the namespace decls into a separate event, there is
no way to reconstruct the attributes of this element in the correct order,
and also there is no way to record the fact that there is extra whitespace
between attr1 and ns2.

Thus, the only way we could see to get the original bytes if you need them
would be to tee the actual bytestream and cache it.  Which we're not, I
believe, going to make a high-priority feature.

DigSig, which has been the oft-used example of needing this, actually only
requires a DOM model of the message, in which inter-element whitespace and
attribute ordering are not significant.

We do still want to have the option of keeping the SAX events around and
recreating the XML in a semantically equivalent form, without lossage (the
"000" -> "0" example), but byte-for-byte isn't really gonna happen.

Glen Daniels
Macromedia
http://www.macromedia.com/
                                Building cool stuff for web developers


Mime
View raw message