[Xml-compile] boolean encoding

Allan Wind allan at goldbamboo.com
Sat May 24 22:33:34 BST 2008


On Sat, May 24, 2008 at 4:52 PM, Mark Overmeer <mark at overmeer.net> wrote:
>> boolean
>>     Contains true, false, 1 (is true), or 0 (is false). Unchecked, the
>> actual value is used. Otherwise, 0 and 1 are preferred for the hash
>> value and true and false in XML.
>
> Wow, that doc is poor.  In the beginning, the check() was merged inside
> the format() and parse(), but once they got seperated that was not
> reflected in the documentation.

They may need some tweaks here and there, but I find the docs helpful
especially after the initial learning curve.

>> That is I am seeing the unchecked behavior, but both the check options
>> are enabled by default and I do not disable them.  This is with 0.78,
>> btw, and I do not notice anything in the changelog saying this was
>> fixed.
>
> Disabling validation will not disable the logic how to interpret fields.
> What about the new text:
>
>  =function boolean
>  Contains C<true>, C<false>, C<1> (is true), or C<0> (is false).
>  When the writer sees a value equal to 'true' or 'false', those are
>  used.  Otherwise, the trueth value is evaluated into '0' or '1'.
>
>  The reader will return '0' (also when the XML contains the string
>  'false', to simplify the Perl code) or '1'.
>
> Better?

The doc change is good.

I am wondering if there is (or should be a way) for the end-user to
specify what the writer (instance) should generate, rather than just
passing through the value from the hash on a per field basis?  As I
said earlier I was able to get the results I needed, so this is
certainly not pressing.


/Allan
-- 
Allan Wind
781 932 4700 x 190
Lead Software Engineer
GoldBamboo, LLC



More information about the Xml-compile mailing list