$elt->{cdata}.= $t->{twig_stored_spaces}.$string unless $t->{twig_skip_next_chunk}; # fixes a bug in XML::Parser for long CDATA if ( $t->{twig_keep_encoding} && defined($string) && length($string)>1024) { $t->{twig_skip_next_chunk} = 1; } else { $t->{twig_skip_next_chunk} = 0; }