Bug 28704 - XmlReader is broken if no newlines between tags
Summary: XmlReader is broken if no newlines between tags
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.XML ()
Version: 3.12.0
Hardware: PC Mac OS
: Highest blocker
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2015-04-02 14:26 UTC by Jeffrey Stedfast
Modified: 2015-04-02 16:45 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Info.plist with all content on a single line (980 bytes, text/plain)
2015-04-02 14:28 UTC, Jeffrey Stedfast
A nicely-formatted version of the same Info.plist file (1.13 KB, text/plain)
2015-04-02 14:29 UTC, Jeffrey Stedfast

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jeffrey Stedfast 2015-04-02 14:26:47 UTC
If the XML is all on a single line with no white space or anything between tags, the XmlReader ends up skipping over nodes. However, if I edit the XML and add newlines and nicely indent the nodes, it works fine.

I'll be attaching 2 Info.plist files to illustrate this bug.

If you copy them into a simple iOS or Mac app and then open the Info.plist file and switch to the "Source" tab at the bottom of the editor, you'll see the layout of what the XmlReader finds in a tree-view editor. You'll notice that even though the XML should be EXACTLY the same, it is parsed differently.
Comment 1 Jeffrey Stedfast 2015-04-02 14:28:02 UTC
Created attachment 10609 [details]
Info.plist with all content on a single line
Comment 2 Jeffrey Stedfast 2015-04-02 14:29:03 UTC
Created attachment 10610 [details]
A nicely-formatted version of the same Info.plist file
Comment 3 Jeffrey Stedfast 2015-04-02 14:31:13 UTC
btw, this is with the following Mono package on Mac: Mono 3.12.1 ((detached/0849ec7 Fri Mar 20 19:07:48 EDT 2015)
Comment 4 Jeffrey Stedfast 2015-04-02 16:45:59 UTC
this was still broken in 4.0 so I figured it might be a bug in the way the PList parser was using XmlReader.

I dropped reader.ReadToNextSibling("key") and replaced it with some manual logic to check the current state to see if it was on a "key" element first.