| XML-XMLWriter documentation | Contained in the XML-XMLWriter distribution. |
XML::XMLWriter::PCData - XML::XMLWriter parsed character data class
@text must be an array of strings.
Every element of @text is parsed and saved. Parsing sofar only means that &, < and > are replaced by their XML entities (&, < and >).
Returns the strings of parsed character data in an array.
| XML-XMLWriter documentation | Contained in the XML-XMLWriter distribution. |
###################################################################### package XML::XMLWriter::PCData; require 5.8.0; ###################################################################### use strict; ######################################################################
###################################################################### sub new { my($class, @text) = @_; my $self = bless({}, ref($class) || $class); for(my $i=0; $i<@text; $i++) { $text[$i] =~ s/&/&/g; $text[$i] =~ s/</</g; $text[$i] =~ s/>/>/g; } $self->{data} = \@text; return $self; } ######################################################################
###################################################################### sub _get { my($self) = @_; return @{$self->{data}}; } ###################################################################### return 1; __END__