I have the following code that loads the xhtml_transitional.xsd file (source at http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd)
private static void SetupSchemas()
{
if (_xmlSchemaSet != null) return;
_xmlSchemaSet = new XmlSchemaSet();
_xmlSchemaSet.ValidationEventHandler += ValidationHandler;
using (var xmlStringReader = new StringReader(Properties.Resources.xhtml_transitional))
{
_xmlSchemaSet.Add(XmlSchema.Read(xmlStringReader, null));
}
_xmlSchemaSet.Compile();
}
Now on all our dev machines (Windows XP, VS 2008 Pro / .Net 3.5 installed) _xmlSchemaSet.GlobalElements contains all 89 elements of the xhtml xsd after the .Compile() call but on Win2k3 Server(s) the same code has 0 .GlobalElements. .. why's that?
Basically what I do is use that _xmlSchemaSet later on for xhtml element validation, but on those server(s) validation always fails because there aren't any elements..
Any ideas why this is happening and what I can do?