http://bugzilla.novell.com/show_bug.cgi?id=562155
http://bugzilla.novell.com/show_bug.cgi?id=562155#c0 Summary: XML parsing fails when executing on iPhone Classification: Mono Product: MonoTouch Version: SVN Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Class Libraries AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- Blocker: --- Created an attachment (id=331963) --> (http://bugzilla.novell.com/attachment.cgi?id=331963) source code that exibits the problem User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 Attached code loads and parses XML document (http://www.w3schools.com/XML/plant_catalog.xml) just fine when executed on desktop mono. But it will fail with exception when executed on iphone using monotouch classlibs. Exception details on iPhone: System.Xml.XmlException: invalid data. at System.Xml.XmlStreamReader.Read (System.Char[] dest_buffer, Int32 index, Int32 count) [0x00000] at Mono.Xml2.XmlTextReader.ReadTextReader (Int32 remained) [0x00000] at Mono.Xml2.XmlTextReader.PeekChar () [0x00000] at Mono.Xml2.XmlTextReader.ReadContent () [0x00000] at Mono.Xml2.XmlTextReader.Read () [0x00000] at System.Xml.XmlTextReader.Read () [0x00000] at parser1.ParseFile (System.String strPath) [0x00000] I manually compiled monotouch classlibs and added detailed logs of internal exception: System.Text.DecoderFallbackException: Exception of type 'System.Text.DecoderFallbackException' was thrown. at System.Text.DecoderExceptionFallbackBuffer.Fallback (System.Byte[] bytesUnknown, Int32 index) [0x00000] at System.Text.UTF8Encoding.Fallback (System.Object provider, System.Text.DecoderFallbackBuffer& buffer, System.Byte[]& bufferArg, System.Byte* bytes, Int64 byteIndex, UInt32 size, System.Char* chars, System.Int32& charIndex) [0x00000] at System.Text.UTF8Encoding.InternalGetChars (System.Byte* bytes, Int32 byteCount, System.Char* chars, Int32 charCount, System.UInt32& leftOverBits, System.UInt32& leftOverCount, System.Object provider, System.Text.DecoderFallbackBuffer& fallbackBuffer, System.Byte[]& bufferArg, Boolean flush) [0x00000] at System.Text.UTF8Encoding.InternalGetChars (System.Byte[] bytes, Int32 byteIndex, Int32 byteCount, System.Char[] chars, Int32 charIndex, System.UInt32& leftOverBits, System.UInt32& leftOverCount, System.Object provider, System.Text.DecoderFallbackBuffer& fallbackBuffer, System.Byte[]& bufferArg, Boolean flush) [0x00000] at System.Text.UTF8Encoding+UTF8Decoder.GetChars (System.Byte[] bytes, Int32 byteIndex, Int32 byteCount, System.Char[] chars, Int32 charIndex) [0x00000] at System.Xml.NonBlockingStreamReader.ReadBuffer () [0x00000] at System.Xml.NonBlockingStreamReader.Read (System.Char[] dest_buffer, Int32 index, Int32 count) [0x00000] at System.Xml.XmlStreamReader.Read (System.Char[] dest_buffer, Int32 index, Int32 count) [0x00000] System.Xml.XmlException: invalid data.. at System.Xml.XmlStreamReader.Read (System.Char[] dest_buffer, Int32 index, Int32 count) [0x00000] at Mono.Xml2.XmlTextReader.ReadTextReader (Int32 remained) [0x00000] at Mono.Xml2.XmlTextReader.PeekChar () [0x00000] at Mono.Xml2.XmlTextReader.ReadContent () [0x00000] at Mono.Xml2.XmlTextReader.Read () [0x00000] at System.Xml.XmlTextReader.Read () [0x00000] at parser1.ParseFile (System.String strPath) [0x00000] at parser1.Start () [0x00000] System.SystemException: System.Text.DecoderFallbackException: Exception of type 'System.Text.DecoderFallbackException' was thrown. at System.Text.DecoderExceptionFallbackBuffer.Fallback (System.Byte[] bytesUnknown, Int32 index) [0x00000] at System.Text.UTF8Encoding.Fallback (System.Object provider, System.Text.DecoderFallbackBuffer& buffer, System.Byte[]& bufferArg, System.Byte* bytes, Int64 byteIndex, UInt32 size, System.Char* chars, System.Int32& charIndex) [0x00000] at System.Text.UTF8Encoding.InternalGetChars (System.Byte* bytes, Int32 byteCount, System.Char* chars, Int32 charCount, System.UInt32& leftOverBits, System.UInt32& leftOverCount, System.Object provider, System.Text.DecoderFallbackBuffer& fallbackBuffer, System.Byte[]& bufferArg, Boolean flush) [0x00000] at System.Text.UTF8Encoding.InternalGetChars (System.Byte[] bytes, Int32 byteIndex, Int32 byteCount, System.Char[] chars, Int32 charIndex, System.UInt32& leftOverBits, System.UInt32& leftOverCount, System.Object provider, System.Text.DecoderFallbackBuffer& fallbackBuffer, System.Byte[]& bufferArg, Boolean flush) [0x00000] at System.Text.UTF8Encoding+UTF8Decoder.GetChars (System.Byte[] bytes, Int32 byteIndex, Int32 byteCount, System.Char[] chars, Int32 charIndex) [0x00000] at System.Xml.NonBlockingStreamReader.ReadBuffer () [0x00000] at System.Xml.NonBlockingStreamReader.Read (System.Char[] dest_buffer, Int32 index, Int32 count) [0x00000] at System.Xml.XmlStreamReader.Read (System.Char[] dest_buffer, Int32 index, Int32 count) [0x00000] I think that problem is caused by (R) symbol in XML document comments. P.S. Already discussed this issue on IRC with Kangaroo Reproducible: Always Steps to Reproduce: 1. Compile & run attached code on desktop mono 2. It will run fine, XML nodes get printed to console 3. Compile & run attached code on iphone using Monotouch classlibs. It will fail with exception. -- 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
