You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
The same is true for attributes that don't occur on the root level. An example is imu.sdf and its gravity_dir_x. The sdf specifies a parent_frame attribute, but this is missing from the generated xsd.
FirefoxMetzger
changed the title
XSD schema generation doesn't parse nested includes (only root-level)
XSD schema generation doesn't parse all nested elements
Jul 25, 2021
@FirefoxMetzger@chapulina - is there a chance that this bug will be fixed anytime soon? We would like to automatically check validity of SDF files against schema, and this looks impossible as the schemas are incomplete. Any advice would help. Thanks!
The current
xmlschema.b
parses eachX.sdf
file and generates an accompanyingX.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 functionprintXSD
, whereas other elements are parsed byprintElem
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.The text was updated successfully, but these errors were encountered: