Lists Home |
Date Index |
On Thursday 27 February 2003 15:26, Elliotte Rusty Harold wrote:
> At 2:39 PM +0000 2/27/03, Alaric B. Snell wrote:
> >No, no, relax; in the scheme I suggested, it uses the type information as
> >*advisory* data on how to encode stuff. It could ignore it all and just
> > put everything in as strings. This is what people refer to as a
> > "Schema-aware compressor".
> I'm not sure what you're suggesting is what Robin's suggesting. Right
> now I'm very confused (not that unusual or even unproductive a state
> to be in, though :-)
> Type-awareness strikes me as fundamentally dangerous, especially in
> this sort of scheme. Yes, it could encode everything as strings but
> given that it doesn't, how do I decode? Do I have to have the schema
> handy? or is the type information bundled into the binary file?
I'd recommend the latter.
> Also, how are elements like these encoded?
In the scheme I suggested for schema-shy people:
> <quantity type="xsd:int">000017</quantity>
> <quantity type="xsd:int">17.00000</quantity>
> <quantity type="xsd:int">17.5</quantity>
string:17.5, or an error if it's been told to validate
> <quantity type="xsd:int">two</quantity>
string:two, or an error if...
> <quantity type="xsd:int">2 and not a fnord</quantity>
string:2 and not..., or an error if...
> <quantity type="xsd:int>Cheesy Poofs</quantity>
string:Cheesy Poofs, or an error if...
But personally I'm not schema-shy; if I declare that something needs to be an
integer and somebody tries to write "five" in there, that will either be
resolved in the UI and the integer '5' written, or an error thrown early on
rather than letting bad data propogate. But that's just a personal feeling.
I guess you're a Perl/Python/TCL type guy rather than a Java/C/Pascal one? :-)
A city is like a large, complex, rabbit