[Po4a-commits] "po4a/lib/Locale/Po4a Sgml.pm,1.127,1.128"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Sat Dec 6 16:09:50 UTC 2008


Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory alioth:/tmp/cvs-serv26440/lib/Locale/Po4a

Modified Files:
	Sgml.pm 
Log Message:
	* NEWS, lib/Locale/Po4a/Sgml.pm: Added support for recursive
	inclusions.  Entities were processed one after another, and could
	be unexpanded when present in a file included by a later entity.


Index: Sgml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Sgml.pm,v
retrieving revision 1.127
retrieving revision 1.128
diff -u -d -r1.127 -r1.128
--- Sgml.pm	6 Dec 2008 15:57:38 -0000	1.127
+++ Sgml.pm	6 Dec 2008 16:09:48 -0000	1.128
@@ -715,10 +715,15 @@
     }
 
     #   Change the entities including files in the document
+    my $dosubstitution = 1;
+    while ($dosubstitution) {
+    $dosubstitution = 0;
     foreach my $key (keys %entincl) {
         # The external entity can be referenced as &key; or &key
         # In the second case, we must differentiate &key and &key2
         while ($origfile =~/^(.*?)&$key(;.*$|[^-_:.A-Za-z0-9].*$|$)/s) {
+	    $dosubstitution = 1; # Since we will include a new file, we
+	                         # must do a new round of substitutions.
 	    my ($begin,$end)=($1,$2);
 	    $end = "" unless (defined $end);
 	    $end =~ s/^;//s;
@@ -774,6 +779,7 @@
 	    print STDERR "substitute $key\n" if ($debug{'entities'});
         }
     }
+    }
     $origfile=~s/\G(.*?)&([A-Za-z_:][-_:.A-Za-z0-9]*|#[0-9]+|#x[0-9a-fA-F]+)\b/$1\{PO4A-amp\}$2/gs;
     if (defined($xmlprolog) && length($xmlprolog)) {
         $origfile=~s/\/>/\{PO4A-close\}>/gs;




More information about the Po4a-commits mailing list