Bug 23651 - System.Xml.XmlReader skips XmlDeclaration on Read() with particular XmlReaderSettings.
Summary: System.Xml.XmlReader skips XmlDeclaration on Read() with particular XmlReader...
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.XML ()
Version: unspecified
Hardware: PC Windows
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2014-10-06 13:08 UTC by Guillermo Leon
Modified: 2015-03-17 16:27 UTC (History)
5 users (show)

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

XmlReader bug. (82.12 KB, application/zip)
2014-10-06 14:32 UTC, Guillermo Leon

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 Guillermo Leon 2014-10-06 13:08:19 UTC
I found that on MonoTouch a XmlReader created with the following settings:

XmlReaderSettings() {
    CheckCharacters = false,
    ConformanceLevel = ConformanceLevel.Fragment,
    IgnoreComments = true,
    IgnoreProcessingInstructions = true,
    IgnoreWhitespace = true,

Skips the Xml declaration, on windows the first call to Read() leaves the reader in the xml declaration node, on iOS it skips this node and goes directly to the next one.

I'm attaching a sample project.

My dev settings:

Xamarin Studio 5.4
Mono 3.8.0
Comment 1 Rolf Bjarne Kvinge [MSFT] 2014-10-06 14:15:19 UTC
Guillermo, there's no attachment, did you forget it?
Comment 2 Guillermo Leon 2014-10-06 14:32:55 UTC
Created attachment 8321 [details]
XmlReader bug.
Comment 3 Guillermo Leon 2014-10-06 14:34:23 UTC
I forgot to attach the project.
Comment 4 Atsushi Eno 2015-03-17 16:27:23 UTC
Now our XmlReader is based on referencesource and the first node returned from the test is <xml>.