Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for XML encoding in Relationship links. Close #31.

  • Loading branch information...
commit ad43369f10603aa948938a160dedcbe17ca4be32 1 parent 5628ad6
@jmcnamara authored
View
2  lib/Excel/Writer/XLSX/Package/Relationships.pm
@@ -187,7 +187,7 @@ sub _write_relationship {
push @attributes, ( 'TargetMode' => $target_mode ) if $target_mode;
- $self->xml_empty_tag( 'Relationship', @attributes );
+ $self->xml_encoded_empty_tag( 'Relationship', @attributes );
}
View
68 t/regression/escapes04.t
@@ -0,0 +1,68 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse('©'), January 2011, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename = 'escapes04.xlsx';
+my $dir = 't/regression/';
+my $got_filename = $dir . $filename;
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members = [];
+my $ignore_elements = { 'xl/workbook.xml' => ['<workbookView'] };
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+# Check encoding of rich strings.
+#
+use Excel::Writer::XLSX;
+
+my $workbook = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+$worksheet->write_url( 'A1', 'http://www.perl.com/?a=1&b=2' );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+ $got_filename,
+ $exp_filename,
+ $ignore_members,
+ $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
View
BIN  t/regression/xlsx_files/escapes04.xlsx
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.