scpeters-test / sdformat

Simulation Description Format (SDF) parser and description files.
http://sdformat.org
Other
1 stars 0 forks source link

Define sdf using XML Schema instead of custom schema #138

Open scpeters-test opened 7 years ago

scpeters-test commented 7 years ago

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


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.

scpeters-test 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.

scpeters-test commented 7 years ago

Original comment by Shane Loretz (Bitbucket: Shane Loretz).


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

scpeters-test commented 7 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters).


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?

scpeters-test 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.

scpeters-test 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.