subtitleeditor: output of .xml file for version control

Project:Linux software
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Related pages:#148: Subtitle editors :-:-: #194: subtitleeditor
Description

I use a lot subtitleeditor to create subtitles to videos.
The application saves the projects in an .xml file.

Also, I have the habit of saving the .xml files in a git version control.

However, the .xml output makes this simple idea a bit difficult: each line of subtitle is saved in a single line in the .xml file, together with all the meta data, e.g.:

  // All in one line:
    <subtitle duration="850" effect="" end="141072" layer="0" margin-l="0" margin-r="0" margin-v="0" name="" note="" path="10" start="140222" style="Default" text="... Monsieur Barnier." translation=""/>

One of the meta data is the "path" number.
If by any chance you missed one line at the beginning of the video, the corresponding path is inserted at the beginning and all the paths are incremented by one.
The problem with this is that the patch file for the version control is unreadable: instead of having one simple path which simply shows the added line, we have a huge path were the whole file has changed.

1) Is the path number really necessary?
2) If it is, can we break the xml line (example above) into separate lines, like this:

<subtitle
   duration="850"
   effect=""
   end="141072"
   layer="0"
   margin-l="0"
   margin-r="0"
   margin-v="0"
   name=""
   note=""
   path="10"
   start="140222"
   style="Default"
   text="... Monsieur Barnier."
   translation=""
/>

At least this way, it would be obvious in the patch that only the path number has changed.

Comments

#1

In the file plugins/subtitleformats/subtitleeditorproject/subtitleeditorproject.cc, the function SubtitleEditorProject.save(FileWriter &file) calls: file.write(xmldoc.write_to_string_formatted()); which is defined in /usr/include/libxml++-2.6/libxml++/document.h.

According to my current abilities, I don't see any easy way to split the xml output.

#2

Related pages:+194: subtitleeditor