in reply to creating an XML string
Another option is to put the string in question into a <![CDATA[...]]>-section.my %ent= ( "&" => 38, "<" => 60, ">" => 62, #... ); $string = "IBM & Microsoft > Sun\n"; print $string; for ( keys %ent ) { $string =~ s/$_/&#$ent{$_};/g } print $string; #prints IBM & Microsoft > Sun
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: creating an XML string
by holli (Abbot) on Dec 28, 2004 at 18:19 UTC |