gazebosim / gazebosim/sdformat

XSD schema generation doesn't parse all nested elements

Open
#633 2 comments 0 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
C++
Stars
216
Forks
125
Avg merge
1d 14h
Merged PRs (30d)
14

Description

The current `xmlschema.b` parses each `X.sdf` file and generates an accompanying `X.xsd` file; however, if any element other than the root element contains a nested `` tag this tag is ignored. This is because the root element is parsed by the function `printXSD`, whereas other elements are parsed by `printElem` and the latter doesn't check for `` tags.

This is a problem with more recent SDFormat files, which introduce `` as a complex type with an optionally nested ``. Pose is now ``d, and hence never makes it into the produced `.xsd`.

The two solutions I can think of are: (1) copy the include parsing code from printXSD to printElem (works, but dirty). Refactor `xmlschema.b` and merge all code paths that parse element tags.

Contributor guide

Open the contributing guide

Research direction

Start in xmlschema.b by comparing how printXSD and printElem handle nested tags, using the pose example with relative_to as the reproduction case. Refactor or consolidate the parsing paths so nested includes appear in the generated .xsd output, then verify generation against the affected SDFormat files.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.