Parent Directory | Revision Log
bunch of changes: make design more modular, implement index (partial implementation) and other small and big changes
1 | dpavlin | 10 | # |
2 | # small function that creates one xml tag | ||
3 | # | ||
4 | |||
5 | # Escape <, >, & and ", and to produce valid XML | ||
6 | my %escape = ('<'=>'<', '>'=>'>', '&'=>'&', '"'=>'"'); | ||
7 | my $escape_re = join '|' => keys %escape; | ||
8 | |||
9 | sub xmlify { | ||
10 | my $tag = shift; | ||
11 | my $out; | ||
12 | |||
13 | $out .= " <$tag>"; | ||
14 | foreach my $v (@_) { | ||
15 | $v =~ s/($escape_re)/$escape{$1}/g; | ||
16 | $out .= $v; | ||
17 | } | ||
18 | $out .= "</$tag>\n"; | ||
19 | return $out; | ||
20 | } |
Name | Value |
---|---|
cvs2svn:cvs-rev | 1.1 |
ViewVC Help | |
Powered by ViewVC 1.1.26 |