gazebosim / gazebosim/sdformat
naming conflicts in generated schema files (xsd)
- Dominant language
- C++
- Stars
- 216
- Forks
- 125
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 14
Description
The file `world.sdf` includes both `model.sdf` and `state.sdf`
https://github.com/ignitionrobotics/sdformat/blob/722b92c92e2b19c408f3d4846ea7fcb5dfa7ed58/sdf/1.8/world.sdf#L62-L68
`state.sdf` in turn includes `model_state.sdf`
https://github.com/ignitionrobotics/sdformat/blob/722b92c92e2b19c408f3d4846ea7fcb5dfa7ed58/sdf/1.8/state.sdf#L37
Both `model_state.sdf` and `model.sdf` define a `` tag:
https://github.com/ignitionrobotics/sdformat/blob/722b92c92e2b19c408f3d4846ea7fcb5dfa7ed58/sdf/1.8/model.sdf#L2
https://github.com/ignitionrobotics/sdformat/blob/722b92c92e2b19c408f3d4846ea7fcb5dfa7ed58/sdf/1.8/model_state.sdf#L2
which in itself shouldn't be a problem, because they exist in different scopes, one inside `` and the other inside ``.
This include chain is reflected in the generated .xsd files; however, the includes are all placed at the top of their respective document, which makes both `` tags appear on the same level inside `world.xsd`, i.e., the nesting of model_state's model is not preserved. This - naturally - leads to a conflict and in the current version model_state's `` overwrites model's ``, which is (very) undesirable.
I'm not 100% sure how to fix this, since I am not familiar enough with the XMLSchema spec, but I assume the solution is something along the lines of renaming state tags, introducing namespaces, or ensuring that model_state's model is included inside the state element (preferred, but not sure if feasible).
Contributor guide
Assessment
This issue has not been assessed yet.