Re: Using CVS to maintain XML
Wayne Johnson wrote: ... > 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? ... You could use a stylesheet, i.e. XSL (http://www.w3.org/Style/XSL/), and sort your tags with xsl:sort. There are a lot of XSL processors, e.g. sablotron (http://www.gingerall.com/). Stephan ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
RE: Using CVS to maintain XML
We had all sorts of problems, and not enough time right now when we started checking in all our InstallAnywhere xml files. We just resorted to making CVS think they were binaries(add -kb) so it wouldn't do all its fun merge thing with it. Though of course you loose lots of other features by making it just a binary(no merge's and so on) but as I am our own developer here that touches the InstallAnywhere stuff, its not that big of deal. If you do figure out a good way to deal with it, I'd love to know. Either post to this list or post it somewhere at ZeroG so other IA5 users can see it! I'd love them to post a FAQ on ways to deal with some little nuances with CVS. I also really wish there was a way to make every single speedfolder always ignore CVS directies(like a default ignore list).hmm. I should post that too the IA wish list on the ZeroG website. - -grant -Original Message- From: Wayne Johnson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 11, 2002 2:58 PM To: [EMAIL PROTECTED] Subject: Using CVS to maintain XML 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. My idea is to sort the IA5 XML before doing any CVS commands on it, thus brining order to the chaos. 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? = --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
Re: Using CVS to maintain XML
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. HTH, /|/|ike ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
RE: Using CVS to maintain XML
Wayne Johnson writes: > 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? It shouldn't be hard to write a small program that does this using the Xerces-C or Xerces-Java APIs. I would not recommend building this into CVS, but you can certainly "strongly encourage" your users to run this program each time before they attempt a checkin or merge (update). The biggest problem you'll face, however, is that InstallAnywhere freely renames the internal nodes that it generates, so an innocuous edit will completely rename about a quarter of your nodes. No amount of node sorting will fix this for you. Anyway, if you want to go down this path, perhaps you can change the installAnywhere invocation script to automatically call an XML sorter. I had to do something like this at a previous job, where I had to translate the absolute path names buried in the .iap file into a templatized form, so that other developers checking out the file could work with a proper path at their end. Anyway, I ended up doing the following: (a) I massaged the .iap file, and wrote a .iap_master file with the templatized paths. I only ever checked in the .iap_master file. (b) Created a couple of "ant" targets: one which I would execute to massage the .iap_master file into the .iap file before launching installAnywhere, and another that would clean up the saved .iap file back into a .iap_master file, which I could use to check back in to CVS. But because of the "unpredictable node renaming", we carefully avoided concurrent editing sessions by placing a watch on the file.. -- Shankar. ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
Using CVS to maintain XML
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. My idea is to sort the IA5 XML before doing any CVS commands on it, thus brining order to the chaos. 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? = --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs