http://bugzilla.novell.com/show_bug.cgi?id=539727


           Summary: XAttribute initialized with boolean value cannot be
                    round-tripped
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Sys.XML
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
          Found By: ---


User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us)
AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9

An expression of the form

new XAttribute("blah", true)

Generates an XAttribute whose value is the string "True", rather than "true".
This, in turn, will cause an explicit conversion from XAttribute to bool to
fail because the conversion method passes the unmodified string value to
XmlConvert.ToBoolean (which insists on lower-case input).

Microsoft's implementation, on the other hand, will generate an XAttribute
whose value is the string "true". Additionally, their implementation appears to
make the string lowercase before passing it to XmlConvert.ToBoolean, which
allows XAttributes with values of "true", "True", and "TRUE" to be converted
successfully to boolean values.

Reproducible: Always

Steps to Reproduce:
1. Create an XAttribute with a bool as the value
2. Explicitly convert the XAttribute to bool.
3.
Actual Results:  
the XAttribute is given the value "True" (or "False") and a
System.FormatException is thrown upon conversion to bool.

Expected Results:  
the XAttribute should be given the value of "true" (or "false"), and conversion
to bool should be case insensitive, allowing for string values of "True",
"TRUE", "False", and "FALSE" to all be successfully converted.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to