HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/share/doc/libxml-writer-perl/examples/double-escaping-example.pl
#!/usr/bin/perl -w

# Demonstrate that ampersands are double-escaped

# Even if your text looks like already-escaped XML, it will be escaped
#  again to make sure that the same text arrives at the other end.

use strict;

use XML::Writer;

my $w = XML::Writer->new();

$w->startTag('doc');
$w->characters('In HTML and XML, an ampersand must be escaped as &');
$w->endTag('doc');
$w->end();