[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: advocating XML
- From: Matt Sergeant <firstname.lastname@example.org>
- To: "Thomas B. Passin" <email@example.com>
- Date: Wed, 14 Mar 2001 09:37:22 +0000 (GMT)
On Wed, 14 Mar 2001, Thomas B. Passin wrote:
> Paul T wrote -
> > Now if you map the A.xml into *regex*line*oriented* file, I bet
> > you be surprised how *trivial* the overall task becomes if doing
> > it in python or perl or any other scripting language that inherits
> > from UNIX.
> When I started working with xml files, I used scripts with REs, and I tried
> to keep my files line-oriented as well. Of course, I used functions and
> methods to produce the output, usually html. I tried to avoid stylesheets and
> parsers. I thought I didn't need them and they were too complicated.
> After awhile, I noticed that it was getting harder and harder as my xml tasks
> became more complex. I had to keep track of a lot of context, and the REs
> were harder to get working right. I also noticed that that it was getting
> really hard to change the html output and make sure it was right.
While I mostly disagree with Paul's general sentiment, it's far too easy
here to say that XML+XSLT is the only system that supports template based
output generation. Perl has some excellent template tools such as
HTML::Template and Text::Template and the Template Toolkit which are
perfect for this kind of job.
Oh, plus if you're using CSV, you don't need regexps at all (Text::CSV in
Perl handles this just fine). But it's sure nice to have the capabilities
of a general purpose language at your disposal before doing any output.
/|| ** Founder and CTO ** ** http://axkit.com/ **
//|| ** AxKit.com Ltd ** ** XML Application Serving **
// || ** http://axkit.org ** ** XSLT, XPathScript, XSP **
// \\| // ** mod_perl news and resources: http://take23.org **