gazebosim / sdformat

Simulation Description Format (SDFormat) parser and description files.
http://sdformat.org
Apache License 2.0
169 stars 97 forks source link

Define sdf using XML Schema instead of custom schema #138

Open osrf-migration opened 7 years ago

osrf-migration commented 7 years ago

Original report (archived issue) by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).


I'm a little confused on how the SDF is defined, so this issue is partly to help me understand.

It appears SDF is defined by a bunch of ".sdf" files. The content of these files appears to be custom, not used outside of the sdformat project, but having the same purpose as XML Schema. sdf files are validated against these ".sdf" files using a custom parser.

There does seem to be a demand to use XML Schema indicated in #2 and pull request #91. The result was a script that translated from the custom format to XML schema.

It seems that the ".sdf" files could be replaced by XML Schema, and the parser could be replaced with another open source library.

osrf-migration commented 7 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


The .sdf should eventually be replaced with an XML schema.

libsdformat currently uses tinyxml to parse XML. We can switch to xerces when the schema is in place so that validation can occur within libsdformat.

osrf-migration commented 7 years ago

Original comment by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).


Related: the *.convert xml documents could be replaced with XSLT

osrf-migration commented 7 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


This would allow us to reuse code in our parser, but I don't know enough about xml schema or stylesheets to make these changes.

I wonder how the footprint of xerces-c compares to tinyxml or tinyxml2?

osrf-migration commented 7 years ago

Original comment by clalancette (Bitbucket: clalancette, GitHub: clalancette).


There's also libxml2, which may be an option. I don't know the relative weights of xerces-c and libxml2, but I can assure you they'll be much larger than tinyxml or tinyxml2. Of course, they also have a lot more functionality. There's also the Windows situation to keep in mind.

osrf-migration commented 7 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


Gazebo used libxml2 at one point. We switched to tinyxml some years ago. I didn't have a bad experience with libxml2, and I have never used xerces. @caguero might be using xerces now.

scpeters commented 4 years ago

@EricCousineau-TRI had also asked at one point about using XSLT and other official XML mechanisms with libsdformat

sgayda2 commented 1 year ago

Given that xerces does not have any active maintainers at this time, would it make sense to consider using libxml2 again? The sdf code is already doing custom validation, so the usage of a schema or stylesheet would simplify the maintenance burden. From my very brief check it also seems like libxml2 is more actively maintained.