XML Text Reader/Writer and Boolean

  • Thread starter Thread starter Ray Price
  • Start date Start date
R

Ray Price

When I write out a boolean with the text writer, it
writes out 'False'. When I try and read it in, using
XmlConvert.ToBoolean, it errors out because it is
expecting 'false' (all lower case). Is this a known bug?

Thanks
 
Ray Price said:
When I write out a boolean with the text writer, it
writes out 'False'. When I try and read it in, using
XmlConvert.ToBoolean, it errors out because it is
expecting 'false' (all lower case). Is this a known bug?

It doesn't sound like a bug to me. It sounds to me like you should be
writing out using XmlConvert.ToString(bool) rather than relying on the
default implementation from a text writer. Don't forget that other
things might particularly want False instead of false.
 
Good point, I have been using the .ToString object
function instead of XmlConvert.ToString!

Many thanks :D
 
Back
Top