Bug 14751 - XmlSchema error: Character content not allowed in an empty model.
Summary: XmlSchema error: Character content not allowed in an empty model.
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.XML ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: marcos.henrich
URL:
Depends on:
Blocks:
 
Reported: 2013-09-14 06:56 UTC by Ian Battersby
Modified: 2014-08-27 09:17 UTC (History)
3 users (show)

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


Attachments
Reproducible Example (11.66 KB, application/zip)
2013-09-14 06:56 UTC, Ian Battersby
Details


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:
Status:
RESOLVED FIXED

Description Ian Battersby 2013-09-14 06:56:57 UTC
Created attachment 4881 [details]
Reproducible Example

Verified against 3.2.0 (although we can't get it to work properly off master either).

NB: Reproducible example attached.

Two issues here:

(1) The output of the transform is not the same as .NET

Expected:-
<?xml version="1.0" encoding="utf-8"?>
<People xmlns="http://tapmantwo.net/foo">
  <Person name="123" />
</People>

Actual:-
<?xml version="1.0" encoding="utf-8"?>
<People xmlns="http://tapmantwo.net/foo">
  <Person name="123">
  </Person>
</People>

(2) The schema validation fails (but passes on .NET)

NB: Seems cause is checks for 'null' whereas this is empty (apart from whiteapce + CR); ironically if (1) didn't happen it might be null, but either way this isn't as per .NET

Expected:-
Passes schema validation without exception.

Actual:-
Unhandled Exception:
System.Xml.XmlException: System.Xml.Schema.XmlSchemaValidationException: XmlSchema error: Not allowed character content was found. XML  Line 3, Position 22.
System.Xml.Schema.XmlSchemaValidationException: XmlSchema error: Character content not allowed in an empty model. XML  Line 4, Position 5.

Very grateful if someone could look at this.
Comment 1 Ian Battersby 2013-10-11 04:53:33 UTC
This is still a massive problem for us, is anyone else seeing it?
Comment 2 marcos.henrich 2014-08-27 08:56:00 UTC
Hi Ian,

Thank you for the detailed bug report.

The pull request for this issue can be found in the link below.
https://github.com/mono/mono/pull/1230
Comment 3 marcos.henrich 2014-08-27 09:17:04 UTC
Fixed in master 48661028204bd1a123e8f4ed18d989585365ad15.
https://github.com/mono/mono/commit/48661028204bd1a123e8f4ed18d989585365ad15