File: quote_xml_version.patch

package info (click to toggle)
libxml-sax-writer-perl 0.56-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 264 kB
  • ctags: 157
  • sloc: perl: 529; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 965 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Subject: use double quotes in xml declarations
Author: Florian Ragwitz <rafl@debian.org>
Reviewed-by: Nicholas Bamber <nicholas@periapt.co.uk>
Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=93623
Last-Update: 2010-08-22
--- a/lib/XML/SAX/Writer/XML.pm
+++ b/lib/XML/SAX/Writer/XML.pm
@@ -479,14 +479,14 @@ sub xml_decl {
     # also, there's order in the pseudo-attr
     my $xd = '';
     if ($data->{Version}) {
-        $xd .= "<?xml version='$data->{Version}'";
+        $xd .= "<?xml version=\"$data->{Version}\"";
         if ($data->{Encoding}) {
-            $xd .= " encoding='$data->{Encoding}'";
+            $xd .= " encoding=\"$data->{Encoding}\"";
         }
         if ($data->{Standalone}) {
-            $xd .= " standalone='$data->{Standalone}'";
+            $xd .= " standalone=\"$data->{Standalone}\"";
         }
-        $xd .= '?>';
+        $xd .= "?>\n";
     }
 
     #$xd = $self->{Encoder}->convert($xd); # this may blow up