#46 closed defect (released)
Resolve problems using custom restrictions of decimal and double
Reported by: | ibboard | Owned by: | ibboard |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | WarFoundry-API | Version: | |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
The WarFoundry-Core.xsd file defines some custom simple types that are used for attributes that can be zero or more, or infinite (which is internally represented as "-1" and is easier to handle than INF).
Currently uses of the types have been replaced with use of the default types (e.g. xs:double) to avoid the errors, but this should be fixed. The only one that works is Percentage, which also uses double but specifies a min and max.
An example stack trace is:
WARN [20:03:36]: LogNotifierHandler.Warn() - Line: 48 - WarFoundryLoader: Conversion from schema type http://ibboard.co.uk/warfoundry/core:infiniteOrNonNegativeInteger (type code Decimal) to String is not supported System.InvalidCastException: Conversion from schema type http://ibboard.co.uk/warfoundry/core:infiniteOrNonNegativeInteger (type code Decimal) to String is not supported at System.Xml.Schema.XmlAtomicValue.get_Value () [0x0026a] in /usr/src/packages/BUILD/mono-2.2/mcs/class/System.XML/System.Xml.Schema/XmlAtomicValue.cs:418 at System.Xml.Schema.XmlSchemaValidator.AssessAttributeLocallyValid (System.Xml.Schema.XmlSchemaAttribute attr, System.Xml.Schema.XmlSchemaInfo info, System.Xml.Schema.XmlValueGetter getter) [0x000af] in /usr/src/packages/BUILD/mono-2.2/mcs/class/System.XML/System.Xml.Schema/XmlSchemaValidator.cs:830 at System.Xml.Schema.XmlSchemaValidator.AssessAttributeElementLocallyValidType (System.String localName, System.String ns, System.Xml.Schema.XmlValueGetter getter, System.Xml.Schema.XmlSchemaInfo info) [0x00053] in /usr/src/packages/BUILD/mono-2.2/mcs/class/System.XML/System.Xml.Schema/XmlSchemaValidator.cs:803 at System.Xml.Schema.XmlSchemaValidator.ValidateAttribute (System.String localName, System.String ns, System.Xml.Schema.XmlValueGetter attributeValue, System.Xml.Schema.XmlSchemaInfo info) [0x000ca] in /usr/src/packages/BUILD/mono-2.2/mcs/class/System.XML/System.Xml.Schema/XmlSchemaValidator.cs:378 at Mono.Xml.Schema.XmlSchemaValidatingReader.Read () [0x00202] in /usr/src/packages/BUILD/mono-2.2/mcs/class/System.XML/Mono.Xml.Schema/XmlSchemaValidatingReader.cs:730 at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) [0x0035c] in /usr/src/packages/BUILD/mono-2.2/mcs/class/System.XML/System.Xml/XmlDocument.cs:991 at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) [0x00192] in /usr/src/packages/BUILD/mono-2.2/mcs/class/System.XML/System.Xml/XmlDocument.cs:919 at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) [0x00192] in /usr/src/packages/BUILD/mono-2.2/mcs/class/System.XML/System.Xml/XmlDocument.cs:919 at System.Xml.XmlDocument.ReadNode (System.Xml.XmlReader reader) [0x0004c] in /usr/src/packages/BUILD/mono-2.2/mcs/class/System.XML/System.Xml/XmlDocument.cs:844 at System.Xml.XmlDocument.Load (System.Xml.XmlReader xmlReader) [0x00019] in /usr/src/packages/BUILD/mono-2.2/mcs/class/System.XML/System.Xml/XmlDocument.cs:708 at IBBoard.WarFoundry.API.Factories.Xml.WarFoundryXmlFactory.CreateXmlDocumentFromStream (System.IO.Stream stream) [0x00013] in /home/ibboard/eclipse/IBBoard.WarFoundry.API/api/Factories/Xml/WarFoundryXmlFactory.cs:290 at IBBoard.WarFoundry.API.Factories.Xml.WarFoundryXmlFactory.GetRootElementFromStream (System.IO.Stream stream, IBBoard.WarFoundry.API.Factories.Xml.WarFoundryXmlElementName elementName) [0x00000] in /home/ibboard/eclipse/IBBoard.WarFoundry.API/api/Factories/Xml/WarFoundryXmlFactory.cs:64 at IBBoard.WarFoundry.API.Factories.Xml.WarFoundryXmlFactory.CreateRaceFromStream (ICSharpCode.SharpZipLib.Zip.ZipFile file, System.IO.Stream dataStream) [0x00000] in /home/ibboard/eclipse/IBBoard.WarFoundry.API/api/Factories/Xml/WarFoundryXmlFactory.cs:138 at IBBoard.WarFoundry.API.Factories.AbstractNativeWarFoundryFactory.CreateRaceFromFile (ICSharpCode.SharpZipLib.Zip.ZipFile file) [0x00000] in /home/ibboard/eclipse/IBBoard.WarFoundry.API/api/Factories/AbstractNativeWarFoundryFactory.cs:121 at IBBoard.WarFoundry.API.Factories.AbstractNativeWarFoundryFactory.DoCreateObjectsFromFile (ICSharpCode.SharpZipLib.Zip.ZipFile file) [0x00038] in /home/ibboard/eclipse/IBBoard.WarFoundry.API/api/Factories/AbstractNativeWarFoundryFactory.cs:93 at IBBoard.WarFoundry.API.Factories.AbstractWarFoundryFactory`1[System.Object].CreateObjectsFromFile (System.IO.FileInfo file) [0x00000] at IBBoard.WarFoundry.API.WarFoundryLoader.LoadObject (System.IO.FileInfo file, IWarFoundryFactory factory) [0x0002f] in /home/ibboard/eclipse/IBBoard.WarFoundry.API/api/WarFoundryLoader.cs:343 at IBBoard.WarFoundry.API.WarFoundryLoader.LoadRaces (System.Collections.Generic.Dictionary`2 raceFiles) [0x00021] in /home/ibboard/eclipse/IBBoard.WarFoundry.API/api/WarFoundryLoader.cs:316
Change History (5)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In r75) Fixes #47 - remove magic numbers
- Create "infinity" in core types
- Redefine special core types without trying to use non-existant INF for Integers
- Use new types in Cats and Race
- Remove special handling of INF when parsing an integer attribute
Closes #46 - Resolve problems using custom restrictions of decimal and double
- New schemas seem to work without exceptioning
comment:4 Changed 10 years ago by
released: | 1 → yes |
---|
Mark released fixes as released using radio values
comment:5 Changed 10 years ago by
Resolution: | fixed → released |
---|
Mark fix as released under a previous version
Note: See
TracTickets for help on using
tickets.
Tried defining unitType as
in race schema (maxNum and maxSize use core:infiniteOrNonNegativeIntger instead of core:integer)
and errors still occur.
Tried adding ID as well as name to types in Core schema and errors still occur.
Tried adding maxExclusive/maxInclusive elements in Core schema and errors still occur.
Tried adding debug source for Mono, but still can't step in to doc.Load() method (which is incredibly useful in Eclipse) or catch and inspect the cast exception as it is thrown.