You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Drew Taylor <dr...@openair.com> on 2000/12/06 01:03:58 UTC

Re: XML::ValidWriter -> \$scaler [Was: mod_perl advocacy project resurrection]

barries wrote:
> 
> On Tue, Dec 05, 2000 at 05:31:49PM -0500, Drew Taylor wrote:
> >
> 
> I've used XML::Checker::Parser with no big issues.

Good to hear. Unfortunately, we are using an older version of
XML::Parser (2.22), while XML::Checker requires 2.23 (according to make
test). I'm not going to even try to get this upgraded on the production
site knowing how finicky XML::Parser can be. But I'll definately keep it
in mind should we upgrade in the future. I see our API becoming much
more important in the near future, and this might help get things
upgraded sooner.

> > My biggest problem with XML::Writer (and hence XML::ValidWriter) is that
> > I can't write to a string, unless there is some hackish workaround.
> 
> XML::ValidWriter writes to a string if you pass in a \$scalar as the
> destination:
> 
>        new
>               $writer = XML::ValidWriter->new( DTD => $dtd, OUTPUT => \*FH ) ;
> 
>            Creates an XML::ValidWriter.
> 
>            The value passed for OUTPUT may be:
> 
>            a SCALAR ref
>                if you want to direct output to append to a
>                scalar.  This scalar is truncated whenever the
>                XML::ValidWriter object is reset() or DESTROY()ed

I stand corrected. :-) I'll play around with XML::ValidWriter and see
what happens. Of course, I also happen to like the way we generate XML
now. It's just a big array of arrays of arrays... reference that is
walked to make the XML. Pretty neat, and the implementation is actually
very simple.

-- 
Drew Taylor
Software Engineer
OpenAir.com - Making Business a Breeze!
Open a free account today at www.openair.com

Re: XML::ValidWriter -> \$scaler [Was: mod_perl advocacy project resurrection]

Posted by barries <ba...@slaysys.com>.
On Tue, Dec 05, 2000 at 07:03:58PM -0500, Drew Taylor wrote:
> barries wrote:
> 
> I stand corrected. :-) I'll play around with XML::ValidWriter and see
> what happens.

It also requires a more recent XML::Parser to slurp up DTDs, but DTDs
can be saved as Perl modules and you don't need to load XML::Parser to
use them.

- Barrie

Re: XML::ValidWriter -> \$scaler [Was: mod_perl advocacy project

Posted by pa...@paymybills.com.
hello

for people using XML::Writer, you can write to a string by using
the IO::String module..


example:

my ($output, $io, $obj);
$io = IO::String->new($output);
tie *IO, 'IO::String';

$obj = new XML::Writer(OUTPUT => $io, DATA_MODE => 1, DATA_INDENT => 1);

.
<code to build xml>
.
.

$obj->end();

print $output;



DESCRIPTION
       The IO::String module provide the IO::File interface for
       in-core strings.  An IO::String object can be attached to
       a string, and will make it possible to use the normal file
       operations for reading or writing data, as well as seeking
       to various locations of the string.  The main reason you
       might want to do this, is if you have some other library
       module that only provide an interface to file handles, and
       you want to keep all the stuff in memory


patrick