texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/Convert/TexinfoXML.pm (format_header


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Convert/TexinfoXML.pm (format_header): remove document wide xml:lang texinfo element attribute as it does not corresponds to the document language settings in Texinfo which should be done with documentlanguage elements and are not a document-wide characteristic.
Date: Mon, 06 Sep 2021 10:26:15 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new f3c9b6d  * tp/Texinfo/Convert/TexinfoXML.pm (format_header): remove 
document wide xml:lang texinfo element attribute as it does not corresponds to 
the document language settings in Texinfo which should be done with 
documentlanguage elements and are not a document-wide characteristic.
f3c9b6d is described below

commit f3c9b6dcc93c163faabf7da0d920534ff8059ad7
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Sep 6 16:26:06 2021 +0200

    * tp/Texinfo/Convert/TexinfoXML.pm (format_header): remove document
    wide xml:lang texinfo element attribute as it does not corresponds to
    the document language settings in Texinfo which should be done with
    documentlanguage elements and are not a document-wide characteristic.
---
 ChangeLog                                          |  7 ++++++
 tp/Texinfo/Convert/TexinfoXML.pm                   |  4 +---
 tp/t/languages.t                                   |  7 ++++++
 .../res_xml/char_latin1_utf8_in_refs.xml           |  2 +-
 .../res_xml/simplest.xml                           |  2 +-
 tp/t/results/languages/multiple.pl                 | 27 ++++++++++++++++++++++
 .../res_parser/formatting_xml/formatting.xml       |  2 +-
 7 files changed, 45 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 756d84e..2ca674b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2021-09-06  Patrice Dumas  <pertusus@free.fr>
 
+       * tp/Texinfo/Convert/TexinfoXML.pm (format_header): remove document
+       wide xml:lang texinfo element attribute as it does not corresponds to
+       the document language settings in Texinfo which should be done with
+       documentlanguage elements and are not a document-wide characteristic.
+
+2021-09-06  Patrice Dumas  <pertusus@free.fr>
+
        * tp/Texinfo/Convert/Converter.pm (set_global_document_commands),
        tp/Texinfo/Convert/HTML.pm (_prepare_elements),
        tp/Texinfo/Convert/IXIN.pm, tp/Texinfo/Convert/Info.pm,
diff --git a/tp/Texinfo/Convert/TexinfoXML.pm b/tp/Texinfo/Convert/TexinfoXML.pm
index b7098ed..2a19434 100644
--- a/tp/Texinfo/Convert/TexinfoXML.pm
+++ b/tp/Texinfo/Convert/TexinfoXML.pm
@@ -262,7 +262,7 @@ sub format_header($)
 
   my $header =  "<?xml version=\"1.0\"${encoding}?>".'
 <!DOCTYPE texinfo PUBLIC "-//GNU//DTD TexinfoML V'.$texinfo_dtd_version.'//EN" 
"http://www.gnu.org/software/texinfo/dtd/'.$texinfo_dtd_version.'/texinfo.dtd">
-'. $self->open_element('texinfo', ['xml:lang', 
$self->get_conf('documentlanguage')])."\n";
+'. $self->open_element('texinfo')."\n";
   if ($self->{'output_file'} ne '') {
     my $output_filename = $self->{'output_filename'};
     $header .= $self->open_element('filename',['file', $output_filename])
@@ -456,8 +456,6 @@ sub output($$)
     }
   }
 
-  $self->set_global_document_commands(-1);
-
   my $result = '';
   $result .= $self->_output_text($self->format_header(), $fh);
   if ($self->get_conf('USE_NODES')) {
diff --git a/tp/t/languages.t b/tp/t/languages.t
index d7d7d72..0d6e3d7 100644
--- a/tp/t/languages.t
+++ b/tp/t/languages.t
@@ -172,12 +172,19 @@ my %info_tests = (
   'unknown_region' => 1,
 );
 
+my %xml_tests = (
+ 'multiple' => 1,
+);
+
 foreach my $test (@test_cases) {
   push @{$test->[2]->{'test_formats'}}, 'plaintext';
   if ($info_tests{$test->[0]}) {
     push @{$test->[2]->{'test_formats'}}, 'info';
     push @{$test->[2]->{'test_formats'}}, 'html';
   }
+  if ($xml_tests{$test->[0]}) {
+    push @{$test->[2]->{'test_formats'}}, 'xml';
+  }
 }
 
 foreach my $test (@file_tests) {
diff --git 
a/tp/t/results/converters_tests/char_latin1_latin1_in_refs/res_xml/char_latin1_utf8_in_refs.xml
 
b/tp/t/results/converters_tests/char_latin1_latin1_in_refs/res_xml/char_latin1_utf8_in_refs.xml
index ae831f0..2df12f5 100644
--- 
a/tp/t/results/converters_tests/char_latin1_latin1_in_refs/res_xml/char_latin1_utf8_in_refs.xml
+++ 
b/tp/t/results/converters_tests/char_latin1_latin1_in_refs/res_xml/char_latin1_utf8_in_refs.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="iso-8859-1" ?>
 <!DOCTYPE texinfo PUBLIC "-//GNU//DTD TexinfoML V5.0//EN" 
"http://www.gnu.org/software/texinfo/dtd/5.0/texinfo.dtd";>
-<texinfo xml:lang="en">
+<texinfo>
 <filename file="char_latin1_utf8_in_refs.xml"></filename>
 <preamble>\input texinfo
 
diff --git 
a/tp/t/results/formatting/split_for_format_not_split/res_xml/simplest.xml 
b/tp/t/results/formatting/split_for_format_not_split/res_xml/simplest.xml
index 03c2a2d..646d8b8 100644
--- a/tp/t/results/formatting/split_for_format_not_split/res_xml/simplest.xml
+++ b/tp/t/results/formatting/split_for_format_not_split/res_xml/simplest.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!DOCTYPE texinfo PUBLIC "-//GNU//DTD TexinfoML V5.0//EN" 
"http://www.gnu.org/software/texinfo/dtd/5.0/texinfo.dtd";>
-<texinfo xml:lang="en">
+<texinfo>
 <filename file="simplest.xml"></filename>
 <preamble>\input texinfo @c -*-texinfo-*-
 
diff --git a/tp/t/results/languages/multiple.pl 
b/tp/t/results/languages/multiple.pl
index 8e08499..4413e16 100644
--- a/tp/t/results/languages/multiple.pl
+++ b/tp/t/results/languages/multiple.pl
@@ -1147,4 +1147,31 @@ $result_converted_errors{'html'}->{'multiple'} = [
 ];
 
 
+
+$result_converted{'xml'}->{'multiple'} = '<documentlanguage xml:lang="fr" 
spaces=" ">fr</documentlanguage>
+
+<copying endspaces=" ">
+<defivar spaces=" " endspaces=" "><definitionterm><indexterm index="vr" 
number="1">a de copying</indexterm><defcategory automatic="on" 
bracketed="on">Instance Variable</defcategory> <defclass>copying</defclass> 
<defclassvar>a</defclassvar> <defparam>b</defparam></definitionterm>
+</defivar>
+</copying>
+
+<node name="Top" spaces=" "><nodename>Top</nodename></node>
+
+<defivar spaces=" " endspaces=" "><definitionterm><indexterm index="vr" 
number="2">BBB de fr</indexterm><defcategory automatic="on" 
bracketed="on">Instance Variable</defcategory> <defclass>fr</defclass> 
<defclassvar>BBB</defclassvar> <defparam>CCC</defparam></definitionterm>
+</defivar>
+
+<documentlanguage xml:lang="de" spaces=" ">de</documentlanguage>
+
+<insertcopying></insertcopying>
+
+<documentlanguage xml:lang="pt" spaces=" ">pt</documentlanguage>
+
+<defivar spaces=" " endspaces=" "><definitionterm><indexterm index="vr" 
number="3">BBB da pt</indexterm><defcategory automatic="on" 
bracketed="on">Instance Variable</defcategory> <defclass>pt</defclass> 
<defclassvar>BBB</defclassvar> <defparam>CCC</defparam></definitionterm>
+</defivar>
+
+<insertcopying></insertcopying>
+
+<printindex value="vr" line="vr"></printindex>
+';
+
 1;
diff --git a/tp/tests/layout/res_parser/formatting_xml/formatting.xml 
b/tp/tests/layout/res_parser/formatting_xml/formatting.xml
index 782a0e0..1ba154e 100644
--- a/tp/tests/layout/res_parser/formatting_xml/formatting.xml
+++ b/tp/tests/layout/res_parser/formatting_xml/formatting.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!DOCTYPE texinfo PUBLIC "-//GNU//DTD TexinfoML V6.8//EN" 
"http://www.gnu.org/software/texinfo/dtd/6.8/texinfo.dtd";>
-<texinfo xml:lang="en">
+<texinfo>
 <filename file="formatting.xml"></filename>
 <preamble>\input texinfo @c -*-texinfo-*-
 </preamble><setfilename file="formatting.info" spaces=" 
">formatting.info</setfilename>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]