Open osrf-migration opened 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.
Original comment by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).
Related: the *.convert
xml documents could be replaced with XSLT
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?
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.
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.
@EricCousineau-TRI had also asked at one point about using XSLT and other official XML mechanisms with libsdformat
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.
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.