0
$\begingroup$

Rosanswers logo

Hi,

I am developing a ROS plugin for Vim and want to add support for editing of roslaunch files. Vim already has a built-in support for omni-completion of XML dialects as soon as the formal definition of a language is provided. So I am wondering does there exist a DTD for the roslaunch XML format?


Originally posted by sergey_alexandrov on ROS Answers with karma: 260 on 2013-04-16

Post score: 4


Original comments

Comment by dornhege on 2013-04-16:
I don't know if there is, but you could make one yourself. Would be nice, if you finish this. My complete vim plugin is currently setfiletype xml.

Comment by sergey_alexandrov on 2013-04-16:
Ha-ha yes, ft=xml is suprisingly useful :) For sure I can create DTD myself, but I just hoped to avoid extra work and also simplify maintenance.

Comment by mikepurvis on 2013-10-17:
@sergey_alexandrov, if you end up doing this, it would be very useful to use as a basis for linting roslaunch files in roslint.

Comment by sergey_alexandrov on 2013-10-17:
@mikepurvis No, in the end I decided it is not worth the effort, sorry...

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

AFAIK there isn't.

One reason is that ROS uses TinyXML for parsing XML files which does not support DTD:

TinyXML doesn't parse or use DTDs (Document Type Definitions) or XSLs (eXtensible Stylesheet Language.) 

...so ROS tools cannot validate your launch file as they are implemented now. This aside, this would be definitively a very nice contribution.


Originally posted by Thomas with karma: 4478 on 2013-09-29

This answer was ACCEPTED on the original site

Post score: 3

$\endgroup$
0
$\begingroup$

Rosanswers logo

I created an XSD and a DTD. It's on https://gist.github.com/nalt/dfa2abc9d2e3ae4feb82ca5608090387 for now. Feel free to comment.

It looks like the XSD is the better choice.

It works for code completion, highlighting and validation with various tools.


Originally posted by Nicolas with karma: 41 on 2018-01-05

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by jrj.fonseca on 2020-04-16:
sory i am new to this i can't install the plugin of sergey, but i want to autocomplete my .launch where do i put your files to my vim autocomplete my launch file

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.