Bug 13959 - XmlSchema error: Referenced element schema type xxx was not found in the corresponding schema (when using embedded files)
Summary: XmlSchema error: Referenced element schema type xxx was not found in the corr...
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.XML ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-08-13 12:26 UTC by Richard Tappenden
Modified: 2013-09-11 05:49 UTC (History)
3 users (show)

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


Attachments
Reproduction (205.67 KB, application/octet-stream)
2013-08-13 12:26 UTC, Richard Tappenden
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 Richard Tappenden 2013-08-13 12:26:42 UTC
Created attachment 4623 [details]
Reproduction

Hi,

We have found a scenario where using embedded XSD files as part of a schema validation library does not work under mono (but does work using .NET 4 on Win8 VS2012).

In the attached reproduction, we have an XSD file (as an embedded resource) which references another XSD file (also embedded) as an xs:include statement.  When we use this XSD file to validate some xml, we get an exception (see bottom of this description).

We have tested this against a version of mono from the main trunk (as of yesterday, 12/08/2013) - as there was another issue with embedded resources that you guys have recently resolved (#13716).

To reproduce, run the Tester app - if you see an exception in the console then something has gone wrong.

Thanks in advance for your attention with this.

Richard.

Unhandled Exception:
System.Xml.Schema.XmlSchemaException: XmlSchema error: Referenced element schema type stringtype was not found in the corresponding schema. Related schema item SourceUri: , Line 6, Position 8.
  at System.Xml.Schema.ValidationHandler.RaiseValidationEvent (System.Xml.Schema.ValidationEventHandler handle, System.Exception innerException, System.String message, System.Xml.Schema.XmlSchemaObject xsobj, System.Object sender, System.String sourceUri, XmlSeverityType severity) [0x00000] in <filename unknown>:0
  at System.Xml.Schema.XmlSchemaObject.error (System.Xml.Schema.ValidationEventHandler handle, System.String message, System.Exception innerException, System.Xml.Schema.XmlSchemaObject xsobj, System.Object sender) [0x00000] in <filename unknown>:0
  at System.Xml.Schema.XmlSchemaObject.error (System.Xml.Schema.ValidationEventHandler handle, System.String message) [0x00000] in <filename unknown>:0
  at System.Xml.Schema.XmlSchemaElement.Validate (System.Xml.Schema.ValidationEventHandler h, System.Xml.Schema.XmlSchema schema) [0x00000] in <filename unknown>:0
  at System.Xml.Schema.XmlSchemaSequence.Validate (System.Xml.Schema.ValidationEventHandler h, System.Xml.Schema.XmlSchema schema) [0x00000] in <filename unknown>:0
  at System.Xml.Schema.XmlSchemaComplexType.ValidateParticle (System.Xml.Schema.ValidationEventHandler h, System.Xml.Schema.XmlSchema schema) [0x00000] in <filename unknown>:0
  at System.Xml.Schema.XmlSchemaComplexType.Validate (System.Xml.Schema.ValidationEventHandler h, System.Xml.Schema.XmlSchema schema) [0x00000] in <filename unknown>:0
  at System.Xml.Schema.XmlSchema.Validate (System.Xml.Schema.ValidationEventHandler handler) [0x00000] in <filename unknown>:0
  at System.Xml.Schema.XmlSchemaSet.Compile () [0x00000] in <filename unknown>:0
  at System.Xml.Schema.XmlSchemaValidator.Initialize () [0x00000] in <filename unknown>:0
  at Mono.Xml.Schema.XmlSchemaValidatingReader..ctor (System.Xml.XmlReader reader, System.Xml.XmlReaderSettings settings) [0x00000] in <filename unknown>:0
  at System.Xml.XmlReader.CreateValidatingXmlReader (System.Xml.XmlReader reader, System.Xml.XmlReaderSettings settings) [0x00000] in <filename unknown>:0
  at System.Xml.XmlReader.CreateFilteredXmlReader (System.Xml.XmlReader reader, System.Xml.XmlReaderSettings settings) [0x00000] in <filename unknown>:0
  at System.Xml.XmlReader.CreateCustomizedTextReader (System.Xml.XmlTextReader reader, System.Xml.XmlReaderSettings settings) [0x00000] in <filename unknown>:0
  at System.Xml.XmlReader.Create (System.IO.TextReader input, System.Xml.XmlReaderSettings settings, System.Xml.XmlParserContext inputContext) [0x00000] in <filename unknown>:0
  at System.Xml.XmlReader.Create (System.IO.TextReader input, System.Xml.XmlReaderSettings settings, System.String baseUri) [0x00000] in <filename unknown>:0
  at System.Xml.XmlReader.Create (System.IO.TextReader input, System.Xml.XmlReaderSettings settings) [0x00000] in <filename unknown>:0
  at EmbeddedXmlResolver.EmbeddedXmlSchemaValidator.ValidateSchema (System.String xmlToValidate, System.String schemaNamespace, System.String xsdPath) [0x00000] in <filename unknown>:0
  at Tester.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 [ERROR] FATAL UNHANDLED EXCEPTION: System.Xml.Schema.XmlSchemaException: XmlSchema error: Referenced element schema type stringtype was not found in the corresponding schema. Related schema item SourceUri: , Line 6, Position 8. at System.Xml.Schema.ValidationHandler.RaiseValidationEvent (System.Xml.Schema.ValidationEventHandler handle, System.Exception innerException, System.String message, System.Xml.Schema.XmlSchemaObject xsobj, System.Object sender, System.String sourceUri, XmlSeverityType severity) [0x00000] in <filename unknown>:0
  at System.Xml.Schema.XmlSchemaObject.error (System.Xml.Schema.ValidationEventHandler handle, System.String message, System.Exception innerException, System.Xml.Schema.XmlSchemaObject xsobj, System.Object sender) [0x00000] in <filename unknown>:0
  at System.Xml.Schema.XmlSchemaObject.error (System.Xml.Schema.ValidationEventHandler handle, System.String message) [0x00000] in <filename unknown>:0
  at System.Xml.Schema.XmlSchemaElement.Validate (System.Xml.Schema.ValidationEventHandler h, System.Xml.Schema.XmlSchema schema) [0x00000] in <filename unknown>:0
  at System.Xml.Schema.XmlSchemaSequence.Validate (System.Xml.Schema.ValidationEventHandler h, System.Xml.Schema.XmlSchema schema) [0x00000] in <filename unknown>:0
  at System.Xml.Schema.XmlSchemaComplexType.ValidateParticle (System.Xml.Schema.ValidationEventHandler h, System.Xml.Schema.XmlSchema schema) [0x00000] in <filename unknown>:0
  at System.Xml.Schema.XmlSchemaComplexType.Validate (System.Xml.Schema.ValidationEventHandler h, System.Xml.Schema.XmlSchema schema) [0x00000] in <filename unknown>:0
  at System.Xml.Schema.XmlSchema.Validate (System.Xml.Schema.ValidationEventHandler handler) [0x00000] in <filename unknown>:0
  at System.Xml.Schema.XmlSchemaSet.Compile () [0x00000] in <filename unknown>:0
  at System.Xml.Schema.XmlSchemaValidator.Initialize () [0x00000] in <filename unknown>:0
  at Mono.Xml.Schema.XmlSchemaValidatingReader..ctor (System.Xml.XmlReader reader, System.Xml.XmlReaderSettings settings) [0x00000] in <filename unknown>:0
 at System.Xml.XmlReader.CreateValidatingXmlReader (System.Xml.XmlReader reader, System.Xml.XmlReaderSettings settings) [0x00000] in <filename unknown>:0
  at System.Xml.XmlReader.CreateFilteredXmlReader (System.Xml.XmlReader reader, System.Xml.XmlReaderSettings settings) [0x00000] in <filename unknown>:0
  at System.Xml.XmlReader.CreateCustomizedTextReader (System.Xml.XmlTextReader reader, System.Xml.XmlReaderSettings settings) [0x00000] in <filename unknown>:0
  at System.Xml.XmlReader.Create (System.IO.TextReader input, System.Xml.XmlReaderSettings settings, System.Xml.XmlParserContext inputContext) [0x00000] in <filename unknown>:0
  at System.Xml.XmlReader.Create (System.IO.TextReader input, System.Xml.XmlReaderSettings settings, System.String baseUri) [0x00000] in <filename unknown>:0
  at System.Xml.XmlReader.Create (System.IO.TextReader input, System.Xml.XmlReaderSettings settings) [0x00000] in <filename unknown>:0
  at EmbeddedXmlResolver.EmbeddedXmlSchemaValidator.ValidateSchema (System.String xmlToValidate, System.String schemaNamespace, System.String xsdPath) [0x00000] in <filename unknown>:0
  at Tester.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
Comment 1 Richard Tappenden 2013-09-02 10:19:48 UTC
Hi,

Wondering if this is on anyones radar?

Cheers

Richard
Comment 2 Richard Tappenden 2013-09-11 05:49:50 UTC
This appears to be resolved in the latest build - thanks!