Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#32 closed enhancement (released)

Migrate WarFoundry files to using Schemas

Reported by: ibboard Owned by: ibboard
Priority: critical Milestone: WarFoundry 0.1
Component: WarFoundry-API Version:
Keywords: Cc:
Blocked By: Blocking: #4, #39

Description

DTDs are now old and inflexible compared to using Schemas. Schemas provide more control over the type of content in an attribute rather than it just being "text", "ID" or "ID reference".

Change History (20)

comment:1 Changed 10 years ago by ibboard

Blocking: 4 added

comment:2 Changed 10 years ago by ibboard

Blocking: 39 added

comment:3 Changed 10 years ago by ibboard

Status: newaccepted

comment:4 Changed 10 years ago by ibboard

(In r50) Re #32 - Migrate WarFoundry to schemas

  • Add "WarFoundry-Core" schema to define numerical types with -1 taking a special value
  • Add "WarFoundry-Cats" to store common category definition between race and system
  • Add full system schema
  • Add partial implementation of race schema

Re #34 - Remove choices and base/increment

  • "WarFoundry-Cats" schema only includes min/max points and percentage

comment:5 Changed 10 years ago by ibboard

(In r52) Re #32 - Migrate WarFoundry files to using Schemas

  • Rename WarFoundry-cats.xml to .xsd
  • Use "all" tag in System instead of "sequence"
  • Complete Race schema

(Add message to correct ticket)

comment:6 Changed 10 years ago by ibboard

(In r53) Re #32 - Migrate WarFoundry files to using Schemas

  • Add missing spaces to Cats and Core XSD
  • Fix some incorrect namespaces in Race XSD
  • Copy schemas to output dir on build
  • Make WarFoundryXmlFactory validate against Schemas
  • Make WarFoundryLoader handle failed file loads slightly differently so that we can log out as a warning
  • Correctly structure "simpleContent" sections of Race XSD

Still to do:

  • Work out why Race XSD doesn't like core:nonNegativeDecimal but appears to be fine with core:percentage
  • Migrate test files to define namespaces and make sure they match the structure

comment:7 Changed 10 years ago by ibboard

Problem with nonNegativeDecimal appears to be in Cats schema as it doesn't define xmln:core, not in the Race schema.

comment:8 Changed 10 years ago by ibboard

(In r54) Re #32 - Migrate WarFoundry files to using Schemas

  • Add namespace for Core to Cats schema
  • Remove duplicate "equipmentitem" definitions from Race schema
  • Correct namespace on nonNegativeInteger and positiveInteger

comment:9 Changed 10 years ago by ibboard

(In r63) Re #32 - Migrate to using Schemas

  • Replace decimal with double to try to get around type cast issues
  • Correct schema to use minNum and maxNum instead of min/maxNumber for attributes
  • Use new FileLoadFailure parameters to better log errors while loading files

comment:10 Changed 10 years ago by ibboard

(In r64) Re #32 - Convert to schemas

  • Remove node count check from factory - Schema should validate document properly
  • Update race schema:
    • Add min and maxOccurs attributes
    • change "points" to "cost"
    • change equipID to ID
    • temporarily replace core:nonNegativeDecimal with xs:integer so that we don't get stuck on validation errors about casting to string

comment:11 Changed 10 years ago by ibboard

(In r65) Re #32 - Migrate to schemas

  • Remove unused method that was still validating by DTD
  • Collapse Cats schema in to one nested structure

System files are failing to validate because:

Problem validating against schema for WarFoundry data: XmlSchema error: Invalid start element: http://ibboard.co.uk/warfoundry/system:cat XML Line 4, Position 4.

which is a <cat> tag, which should match the Cat schema definition. Removing the tags results in a different error about the end </categories> tag being unexpected because of missing content.

comment:12 Changed 10 years ago by ibboard

Problem with <cat> tag is probably caused by namespace issues - should be <core:cat> as <cat> is defined in the "core" namespace.

comment:13 Changed 10 years ago by ibboard

(In r66) Re #32 - Migrate to schemas

  • Add defaultStats attribute to System schema
  • <cat> problem resolved by importing Category schema namespace and using <cats:cat>

comment:14 Changed 10 years ago by ibboard

(In r68) Re #32 - Migrate to schema

  • Remove use of Categories (now just has a single category)
  • Fix infinite loop of trying to load files by adding a "is loading" flag
  • Fix invalid setting of MinSize to MaxNumber when we're testing if MinSize > MaxSize

comment:15 Changed 10 years ago by ibboard

Migration complete in r68. Other tickets will be opened to resolve remaining issues that aren't directly Schema related.

comment:16 Changed 10 years ago by ibboard

(In r71) Re #32 - Migrate to schemas

  • Convert Army to schema
  • Delete old DTDs

comment:17 Changed 10 years ago by ibboard

Resolution: fixed
Status: acceptedclosed

Main migration complete. Ticket #46 opened for problem using some custom types for attribute type.

comment:18 Changed 10 years ago by ibboard

released: 1

Mark released changes as released

comment:19 Changed 10 years ago by ibboard

released: 1yes

Mark released fixes as released using radio values

comment:20 Changed 9 years ago by ibboard

Resolution: fixedreleased

Mark fix as released under a previous version

Note: See TracTickets for help on using tickets.