You are viewing a plain text version of this content. The canonical link for it is here.
Posted to p-dev@xerces.apache.org by Carlos Abalde Ramiro <in...@ucv.udc.es> on 2001/07/31 11:43:44 UTC

"XML::Xerces::DOMParse::print" question

Hi,

I'm working with the Xerces-Perl parser to build DOM trees and then
write XML strings (like DOMCreate.pl sample). The problem:
with "XML::Xerces::DOMParse::print (\*STDOUT, $doc);" the
output goes to STDOUT, but I want to store this XML output in a Perl
string... Anyone can help me?

Thanks, Carlos.


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org


Re: "XML::Xerces::DOMParse::print" question

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Carlos Abalde Ramiro" <in...@ucv.udc.es> writes:

> I'm working with the Xerces-Perl parser to build DOM trees and then
> write XML strings (like DOMCreate.pl sample). The problem: with
> "XML::Xerces::DOMParse::print (\*STDOUT, $doc);" the output goes to
> STDOUT, but I want to store this XML output in a Perl
> string... Anyone can help me?

Hola Carlos,

Thanks for using Xerces.pm.

First, a slight explanation. DOMParse.pm was written by Tom Watson
when he wrote the original port of Xerces 1.1 for windows. I updated
it (somewhat) for the port of 1.3 to linux, but it is likely in need
of some further updating.

Second, DOMParse::print() prints to whatever filehandle you
specify. So if you pass a filehandle that is actually a string, that
is probably the simplest way to do what you want. Take a look at the
CPAN module IO::Scalar for this.

Third, DOMParse assumes the use of DOM. I have not updated it to use
the new IDOM classes (which are just an experimental more efficient
DOM implementation). 

jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org