Opened 3 years ago

Last modified 2 years ago

#6336 new defect

RelaxNGValidator bogus error messages, also probably bad schema error handling.

Reported by: nani Owned by:
Priority: Nice to Have Milestone: Backlog
Component: Core engine Keywords: xml validation errors bogus
Cc: Patch:

Description

RelaxNGValidator gives nonsense error messages for cases where it should tell you exactly what is wrong and what is not.

ERROR: RelaxNGValidator: Validation error: gaia/fauna_chicken:1: Expecting an element Resources, got nothing

In this case it fails to tell you, you have added an invalid element as an entry and instead makes you believe something completely unrelated is happening, like for example not having defined something you did in fact define (Resources element).

How to reproduce:

1) Go to the file simulation/templates/template_unit.xml

2) Add <PopulationBonus>0</PopulationBonus> inside <Cost> element after sibiling element <Population>

3) Run Caspian Sea (2v2) skirmish map

...
<Entity>
  <AIProxy/>
  <Cost>
    <Population>1</Population>
    <PopulationBonus>0</PopulationBonus>
    <BuildTime>1</BuildTime>
    <Resources>
      <food>0</food>
...

4) Many nonsense errors where none tell you <PopulationBonus> is invalid child element of <Cost>

Change History (2)

comment:1 by Vladislav Belov, 3 years ago

Component: SimulationCore engine

The problem is that we use a third party library libxml and particularly its RelaxNG.

comment:2 by Freagarach, 2 years ago

Milestone: Alpha 26Backlog
Note: See TracTickets for help on using tickets.