Version control programs for XML-files – merge/diff tool

version controlxml

My programming environment / language (gamemaker) gives the source files as "XML-files". Each resource has its own XML file. Where the properties (code is a property) are stored inside xml tags.

Is there a source control which can handle these? With subversion collisions don't seem to be handled correctly: when a collision happens, subversion breaks the XML structure. Which in turn breaks Gamemaker when updating.

EDIT (editing here as comments don't seem to handle newlines :P), an example of a source file that got "destroyed" by subversion:

<object>
  <spriteName>sprBall</spriteName>
  <solid>0</solid>
  <visible>-1</visible>
  <depth>0</depth>
  <persistent>0</persistent>
<<<<<<< .mine
  <parentName>self</parentName>
=======
  <parentName>objExplosion</parentName>
>>>>>>> .r16
  <maskName>&lt;undefined&gt;</maskName>
  <events/>
</object>

EDIT2: because of lack of experience with these tools, I asked the wrong question. So here a better wording:

In the example above an xml-file-reader will crash when trying to read the file. However manually resolving the conflict is "hard". (And in extreme cases impossible). "" doesn't say anything in itself. – As the first question becomes "parent name of what?"- An object? – which object? In this case one can see it quickly. However if the xml file reaches 100+ lines with 6-7 layers of tags it becomes a mess just looking through it. Especially as many tags are not named the same as they are in the IDE.

What I hoped to have is that the conflict to be changed in such a way an xml-reading library can read it. – For example that the .r16 change is displayed into a comment (or subtag/attribute).

<parentName>self 
<!--.r16: objExplosion--></parentName>

From that point on I can program a tool to help analyzing the conflict. – I can use one of the many xml libraries to write a simple application visualizing the tree.

Well I'm just surprised this hasn't been a problem to anyone else :/.

Best Answer

It looks like you you saying that a file with unresolved conflicts breaks Gamemaker.

Well, I'd expect that regardless the file type or system. You need to resolve all the conflicts before building. There's no way that having a file marked with unresolved conflicts can keep the structure of that file valid.

If this was a C# or Java source file I'd expect to get compiler errors if I tried to build the project with the file in this state.

Related Topic