Ticket #413 (closed task: fixed)

Opened 3 years ago

Last modified 3 years ago

Automatic validation of entity templates

Reported by: Philip Owned by: Philip
Priority: Should Have Milestone:
Component: UI & Simulation Keywords:
Cc:

Description

Entity templates are a kind of tree structure, defined by a series of XML files (each inheriting from a parent file and overriding some parts). To save component code from having to worry about detecting and reporting invalid input (missing fields, incorrect data types, etc) there should be a centralised validation system. Each component reports its requirements, and the validator checks each template against them.

It would probably be sensible to use libxml2's RelaxNG support for this, since it provides a reasonable schema language for checking the structure and data types. The entity template can be serialised into XML (after applying all the inheritance rules etc) and then validated. If validation fails then the entity won't be loaded. It'd be particularly nice to use the RelaxNG Compact syntax, but libxml2 doesn't support that (it just has a half-finished RNC->RNG converter in its source control repository that is of unknown quality), so I don't know how feasible that is.

For efficiency (if it turns out that it matters), the validation status of entity templates could perhaps be cached at the same time as they're converted to XMB.

Change History

comment:1 Changed 3 years ago by Philip

  • Milestone changed from Unclassified to Simulation stage 4

See also #245

comment:2 Changed 3 years ago by philip

(In [7452]) # Initial support for automatic validation of entity template XML. Add RelaxNG schemas for all current components. Add -dumpSchema command-line option to dump the combined entity schema. Add a Perl script to validate entity templates against the schema. See #413.

comment:3 Changed 3 years ago by philip

  • Status changed from new to closed
  • Resolution set to fixed

(In [7455]) # Automatic runtime validation of entity template files. Fixes #413.

comment:4 Changed 3 years ago by anonymous

  • Milestone Simulation stage 4 deleted

Milestone Simulation stage 4 deleted

Note: See TracTickets for help on using tickets.