[Top][All Lists]

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

RE: merge mode for XML

From: Greg A. Woods
Subject: RE: merge mode for XML
Date: Fri, 26 Apr 2002 17:45:05 -0400 (EDT)

[ On Friday, April 26, 2002 at 06:51:36 (-0700), EXT-Corcoran, David wrote: ]
> Subject: RE: merge mode for XML
> It helps me to think of a plain ASCII text file source (C,java,perl etc) as
> a markup language where a newline is the only tag.


> To extend the delta generation of a more structured markup language, such as
> XML, probably would require knowledge of that syntax by the diff program.

Just as it could with any language.  (eg. C statements and expressions
should really be treated as units)

> A quick an dirty approach may be to prefix all opening tags with a newline,
> suffix all closing tags with a newline, and then remove all blank lines
> unless inside a tag (in and among CDATA); essentially run it through an xml
> equiv of cb(1) or indent(1).

Doesn't everyone format their XML like that?  I.e. like HTML so that
tags are on their own lines and there are extra blank lines (that won't
be treated as data) between groups of items and even between items too?

A better approach is to avoid XML entirely in the first place -- it's a
really really horrid syntax with all kinds of goo that's usually way
over-kill for the application, being SGML based and all that....

You're no worse off defining a proper little language for your data.
Writing a parser with modern grammar compilers is no harder than writing
a good DTD, and it means you can avoid having to have all that annoying
useless syntax that just gets in your way.  By following common
approaches to simple data description syntax design one can even make a
custom little language trivial for most programmers to learn (thus
avoiding one of the few arguments against using a custom language).

                                                                Greg A. Woods

+1 416 218-0098;  <address@hidden>;  <address@hidden>;  <address@hidden>
Planix, Inc. <address@hidden>; VE3TCP; Secrets of the Weird <address@hidden>

reply via email to

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