[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using CVS to maintain XML

From: Mike Ayers
Subject: Re: Using CVS to maintain XML
Date: Wed, 11 Dec 2002 22:23:08 -0800
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130

Wayne Johnson wrote:
We're using InstallAnywhere5.  One of the features of IA5 is that the
builder control file is in XML.  We were sort of hoping that we could use
CVS to manage these files. It works fine until we attempt merges.
The problem is that in order for CVS to properly merge the file, there
needs to be some structure to the file.  In most source, this is simply
due to the fact that programmers just don't go moving functions around. In XML, you can rearrange the contents of an XML object without affecting the meaning.

Ummm - yes and no. Specifically, you can rearrange the tags within a level, but must strictly maintain all containment.

My idea is to sort the IA5 XML before doing any CVS commands on it, thus
brining order to the chaos.

I wouldn't call this a "sort". I think the term "canonicalize" would better fit what you wish to do. This also implies that you would work from the DTD or schema for the XML in question, and sort the tags at each level into the order they appear in that schema or DTD. Really, XML tools should do this anyway to be good citizens, even though it is not strictly required.

Anyone know a good way to manage XML in CVS?  Is there a program that
will sort an XML file?  To make sure that similar tags always appear in
the same order?  Am I just dreaming?

Please note that this is not an issue of managing XML in CVS per se. XML files work fine in CVS. However, because the differences between two XML files as viewed by an XML parser are potentially a small subset the textual changes to that file, the diffs as reported by CVS may not be the differences that you are interested in.

Because of this, I would suggest that, rather than build a preprocessing utility to be used prior to checkin, you should construct an XML diff program that takes two XML files and reports the XML difference, which is what interests you. This way, you would check in the machine generated XML as is (always a good idea for machine generated files), and diff them. I would expect that you could find an XML diff program already written. I am not sure how, or if, it could be integrated into CVS.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]