Bug 27971 - XmlResolver not called when parsing XSD-based XML
Summary: XmlResolver not called when parsing XSD-based XML
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.XML ()
Version: 3.12.0
Hardware: Other Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-03-12 12:39 UTC by Nick Parker
Modified: 2015-03-17 17:02 UTC (History)
2 users (show)

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


Attachments
C# file example and test XML file (1.16 KB, application/x-zip-compressed)
2015-03-12 12:39 UTC, Nick Parker
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 Nick Parker 2015-03-12 12:39:34 UTC
Created attachment 10303 [details]
C# file example and test XML file

When validating an XML file using XSD schémas the XMLResolver is not called as it is under Windows.

Compilation : csc resolverbug.cs

Run with example output :

UNDER WINDOWS :

U:\bugs\Mono\XmlResolver>resolverbug.exe

resolve uri  / http://bibnum.bnf.fr/ns/refNum.xsd
get ent
Impossible de charger le schéma pour l'espace de noms 'http://bibnum.bnf.fr/ns/refNum' : La référence d'objet n'est pas définie à une instance d'un objet..
resolve uri  / http://bibnum.bnf.fr/ns/detailsOperation.xsd
get ent
Impossible de charger le schéma pour l'espace de noms 'http://bibnum.bnf.fr/ns/detailsOperation' : La référence d'objet n'est pas définie à une instance d'un objet..
Impossible de trouver les informations de schéma pour l'élément 'http://bibnum.bnf.fr/ns/refNum:refNum'.

UNDER LINUX USING MONO 3.12.0

[npar@stol-file001 ~]$ mono resolverbug.exe
Could not resolve schema location URI: http://bibnum.bnf.fr/ns/refNum http://bibnum.bnf.fr/ns/refNum.xsd http://bibnum.bnf.fr/ns/detailsOperation http://bibnum.bnf.fr/ns/detailsOperation.xsd XML  Line 1, Position 40.
Could not resolve schema location URI: http://bibnum.bnf.fr/ns/refNum http://bibnum.bnf.fr/ns/refNum.xsd http://bibnum.bnf.fr/ns/detailsOperation http://bibnum.bnf.fr/ns/detailsOperation.xsd XML  Line 1, Position 40.


Because it's a small demonstration program, the program always stops badly. The important thing to note is that when the XmlResolver is called it indicates this with the message "resolve uri" on the console.
Under Windows, the resolver is called and indicates its presence (even if in the example it does nothing).
Under Mono, we get unresolved schema messages when the resolver wasn't even called.

The attachment includes the source code and a simple example XML file to run it with.
Comment 1 Atsushi Eno 2015-03-17 17:02:30 UTC
Now the related classes are based on referencesource and it works as described.