Gazebo Diary – Vol. 4 (SDF Validator)

Binnur Görer · January 17, 2014

I have to validate the correctness of the SDF editor as the user enters new entries or change some parts of it. Since the SDF file is based on XML, I have to check for XML syntax first and then for the SDF syntax. For the XML validator, I found the Xerces C++ library which can be used to parse, manipulate and validate the XML files. It returns the line number where the error is occurred. I highlighted this line with red colour and print the error message in the widget just below the editor. In this way, the user can recognize his/her error while editing the SDF file.

The editor switched to the code editor of QT from plain text editor in order to show the line numbers and highlight the current line. SDFValidator_V1

Twitter, Facebook