gazebosim/sdformat

XSD schema generation doesn't parse all nested elements

Ouverte

#633 ouverte le 24 juil. 2021

 (2 commentaires) (0 réaction) (0 personne assignée)C++ (122 forks)auto 404
bughelp wanted

Métriques du dépôt

Stars
 (216 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

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 <include> 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 <include> tags.

This is a problem with more recent SDFormat files, which introduce <pose> as a complex type with an optionally nested <relative_to>. Pose is now <include>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.

Guide contributeur