Alex,
I do a similar search/replace technique with a HTML template file. If a
customized
approach is something you'll continue with, then read the entire file all at
once
instead of line by line, and pass a reference to $r->print(). I've been
happy with
the following:
my $fh = Apache->gensym;
open($fh, $filename);
read $fh, my $data, -s $filename;
$data =~ s/<!--tabledata-->/$query/;
...
$r->print(\$data);
Regards,
Craig Bullock
-----Original Message-----
From: Alex Menendez <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>;
[EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Wednesday, December 08, 1999 10:56 PM
Subject: simple xml parsing within html
hello, all
I currently have developed a dynamic content engine in mod_perl that
parses html files on the fly for
proprietary xml tags then replaces these tag trees with db content.
I initially tried to do this by subclassing HTML::Parser and over-riding
the usual methods. However, this
was painfully slow.....even after chunking the files line by line. I got
better performance by writing my own module that specifically parsed the
file for my tags. However, the performance is still not that great and
my module is not exactly robust.
any suggestions on making HTML::Parser work faster....or on another
module that can parse XML within a tree of non xml compliant tags....ie
HTML?
-amen