RE: Help with sorting another file


Subject: RE: Help with sorting another file
From: Arthur Corliss (acorliss@nevaeh-linux.org)
Date: Thu Feb 26 2004 - 15:19:20 AKST


On Thu, 26 Feb 2004, Troy Melhase wrote:

> No, I think I get your point completely. I think the miscommunication may
> stem from your distinction between "app" and "xml app". I don't think of
> such differences, instead, I see XML as another encoding format (along with
> binary files, text files, database records, etc., it's all just an input).

I'm not going to argue that XML isn't just another form of encoding, but I
will argue that a distinction should be made between a proper XML app and any
other automated use. This is a distinction based on practicality, and is
definitely influenced by the complexity of the data structure.

In ordinary circumstances an app should be XML-compliant if it's required to
do any kind of alterations on the data which is going to be passed on to other
XML apps. But if, for instance, I just wanted to extract program listings and
times for my favourite shows and spit it into an e-mail I would most
definitely use sed. It's a much simpler and faster way to do so than with a
"proper" XML implementation.

In the example given I am allowing an exception to the above rule simply
because it also (easier and faster) accomplishes what he wanted, and the app
the stream is ultimately going to is broken enough. This level of altertaion
(complete block removal) is just too simple an operation to waste to a bigger
program.

> Not necessarily (but you're right in the sense that apps using xml poorly
> will break).
>
> You're also right in that using a DOM parser will tie an app more closely to
> the source structure, but just using a SAX parser gives a mote of
> transparency. The best method is to transform the source to an intermediate
> text (or secondary XML) format and then traversing that structure instead.
> As they say in the python community, "one more level of redirection never
> hurts." :D

My philosophy in UNIX is to use the tool most appropriate to the job. I know
a lot of Perl hackers that have completely forsaken awk and sed just because
it can do the same thing. In most cases, however, using Perl is like using a
20 sledge hammer when all you need is a 12 ounce ballpeen. :-P

> Use of DTDs is deprecated, btw. A thoughtful XSLT transformation will be
> resilient to minor or even significant changes in the source grammar.

I'm not an XML'er, so this I didn't know. Good info. :-)

        --Arthur Corliss
          Bolverk's Lair -- http://arthur.corlissfamily.org/
          Digital Mages -- http://www.digitalmages.com/
          "Live Free or Die, the Only Way to Live" -- NH State Motto
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Thu Feb 26 2004 - 15:19:51 AKST