# HG changeset patch # User IBBoard # Date 1276372172 0 # Node ID 3f14a792fd41eaa51fffddeff5a6566d9ebba50b # Parent a3c1bf57fd3fea49c23a7cd88ec0a27517006c52 Re #274: Crash when missing unit member ID * Add key and keyref for member type Re #290: Migrate to using key/keyref definitions instead of ID/IDREF type * Move keyref and key for equipment slot to correct place to be valid * Add aliased xmlns for schema to allow for use in XPath, which doesn't use default namespace * Disable warning reporting until Mono Bug 613684 is fixed (https://bugzilla.novell.com/show_bug.cgi?id=613684) diff -r a3c1bf57fd3f -r 3f14a792fd41 api/Factories/Xml/WarFoundryXmlFactoryUtils.cs --- a/api/Factories/Xml/WarFoundryXmlFactoryUtils.cs Sat Jun 05 18:57:46 2010 +0000 +++ b/api/Factories/Xml/WarFoundryXmlFactoryUtils.cs Sat Jun 12 19:49:32 2010 +0000 @@ -63,7 +63,7 @@ { settings = new XmlReaderSettings(); settings.ValidationType = ValidationType.Schema; - settings.ValidationFlags = XmlSchemaValidationFlags.ReportValidationWarnings; + //settings.ValidationFlags = XmlSchemaValidationFlags.ReportValidationWarnings; settings.ProhibitDtd = true; settings.ValidationEventHandler+= new ValidationEventHandler(ValidationEventMethod); XmlSchemaSet cache = new XmlSchemaSet(); @@ -82,7 +82,14 @@ private static void ValidationEventMethod(object sender, ValidationEventArgs e) { - throw new InvalidFileException("Problem validating against schema for WarFoundry data: " + e.Message, e.Exception); + if (e.Severity == XmlSeverityType.Error) + { + throw new InvalidFileException("Problem validating against schema for WarFoundry data: " + e.Message, e.Exception); + } + else + { + //TODO: Fire some kind of warning event + } } private static void AddSchemaToCache(XmlSchemaSet cache, string xmlNamespace, string schemaLocation) diff -r a3c1bf57fd3f -r 3f14a792fd41 schemas/race.xsd --- a/schemas/race.xsd Sat Jun 05 18:57:46 2010 +0000 +++ b/schemas/race.xsd Sat Jun 12 19:49:32 2010 +0000 @@ -1,6 +1,6 @@ +targetNamespace="http://ibboard.co.uk/warfoundry/race" xmlns="http://ibboard.co.uk/warfoundry/race" xmlns:race="http://ibboard.co.uk/warfoundry/race" elementFormDefault="qualified"> @@ -8,7 +8,16 @@ - + + + + + + + + + + @@ -60,6 +69,14 @@ + + + + + + + + @@ -81,10 +98,6 @@ - - - - @@ -107,10 +120,6 @@ - - - -