Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/intltool/Makefile.am,v
retrieving revision 1.31
diff -u -p -r1.31 Makefile.am
--- Makefile.am	6 Dec 2003 00:02:25 -0000	1.31
+++ Makefile.am	18 Dec 2003 19:06:28 -0000
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS = . tests doc doc-i18n-tool modules
+SUBDIRS = . tests doc doc-i18n-tool
 
 NULL = 
 
Index: NEWS
===================================================================
RCS file: /cvs/gnome/intltool/NEWS,v
retrieving revision 1.37
diff -u -p -r1.37 NEWS
--- NEWS	8 Dec 2003 22:41:14 -0000	1.37
+++ NEWS	18 Dec 2003 19:06:28 -0000
@@ -14,6 +14,9 @@ an eye on intltool at the same time.
 
 Thanks guys!
 
+* Removed OrigTree in favor of more simply setting handlers directly
+  in intltool-merge (Brian Cameron)
+
 * made intltool-merge use XML::Parser (#116526 and others) [Brian Cameron]
 
   - added and updated tests
@@ -23,7 +26,7 @@ Thanks guys!
     before/after translation.
   - Added it to build, made it install (Kenneth Christiansen)
     - Added missing DESTDIR (Abel Cheung)
-    - Also nstall OrigTree.pm in the distribution tree (Malcolm Tredinnick)
+    - Also install OrigTree.pm in the distribution tree (Malcolm Tredinnick)
     - Check for the XML::Parser module at build time (Malcolm Tredinnick)
 
 * Added INTLTOOL_KBD_RULE for GOK\s *.kdb files (Bill Haneman)
Index: README
===================================================================
RCS file: /cvs/gnome/intltool/README,v
retrieving revision 1.20
diff -u -p -r1.20 README
--- README	6 Dec 2003 13:22:58 -0000	1.20
+++ README	18 Dec 2003 19:06:28 -0000
@@ -43,10 +43,9 @@ To use intltool in your module, do the f
 
 	AC_PROG_INTLTOOL([minimum required version])
 
- o Add intltool-extract.in, intltool-merge.in, intltool-update.in and
-   intltool-modules/XML/Parser/Style/OrigTree.pm to EXTRA_DIST in your
-   top-level Makefile.am and also to the top-level .cvsignore. Also add the
-   non-.in versions to .cvsignore
+ o Add intltool-extract.in, intltool-merge.in, and intltool-update.in
+   to EXTRA_DIST in your top-level Makefile.am and also to the top-level
+   .cvsignore. Also add the non-.in versions to .cvsignore.  
 
  o Remove po/desk.pl and po/update.* scripts.  intltool-update will take
    over their functionality.
Index: configure.in
===================================================================
RCS file: /cvs/gnome/intltool/configure.in,v
retrieving revision 1.45
diff -u -p -r1.45 configure.in
--- configure.in	1 Dec 2003 21:39:10 -0000	1.45
+++ configure.in	18 Dec 2003 19:06:28 -0000
@@ -66,7 +66,6 @@ AC_OUTPUT([
 Makefile
 doc-i18n-tool/Makefile
 doc/Makefile
-modules/Makefile
 intltool-extract.in
 intltool-merge.in
 intltool-prepare
Index: intltool-merge.in.in
===================================================================
RCS file: /cvs/gnome/intltool/intltool-merge.in.in,v
retrieving revision 1.83
diff -u -p -r1.83 intltool-merge.in.in
--- intltool-merge.in.in	11 Dec 2003 10:34:15 -0000	1.83
+++ intltool-merge.in.in	18 Dec 2003 19:06:28 -0000
@@ -47,17 +47,6 @@ if(!$ret) {
     die "You must have XML::Parser installed to run $0\n\n";
 } 
 
-## Add dir to own perl modules
-my $dir = dirname($0);
-push @INC, "@EXPANDED_DATADIR@/@PACKAGE@";
-push @INC, "$dir/modules";
-push @INC, "$dir/intltool-modules";
-
-$ret = eval 'require XML::Parser::Style::OrigTree';
-if(!$ret) {
-    die "The OrigTree module doesn't seem to be properly installed $0\n\n";
-}
-
 my $must_end_tag      = -1;
 my $last_depth        = -1;
 my $translation_depth = -1;
@@ -118,28 +107,28 @@ my $q = "[^\\\"]*";
 
 if ($VERSION_ARG) 
 {
-	&print_version;
+        &print_version;
 } 
 elsif ($HELP_ARG) 
 {
-	&print_help;
+        &print_help;
 } 
 elsif ($BA_STYLE_ARG && @ARGV > 2) 
 {
-	&preparation;
-	&print_message;
-	&ba_merge_translations;
-	&finalize;
+        &preparation;
+        &print_message;
+        &ba_merge_translations;
+        &finalize;
 } 
 elsif ($XML_STYLE_ARG && @ARGV > 2) 
 {
         &utf8_sanity_check;
-	&preparation;
-	&print_message;
-	
-    &xml_merge_output;
+        &preparation;
+        &print_message;
 
-	&finalize;
+        &xml_merge_output;
+
+        &finalize;
 } 
 elsif ($KEYS_STYLE_ARG && @ARGV > 2) 
 {
@@ -147,32 +136,32 @@ elsif ($KEYS_STYLE_ARG && @ARGV > 2) 
         &preparation;
         &print_message;
         &keys_merge_translations;
-	&finalize;
+        &finalize;
 } 
 elsif ($DESKTOP_STYLE_ARG && @ARGV > 2) 
 {
         &preparation;
         &print_message;
         &desktop_merge_translations;
-	&finalize;
+        &finalize;
 } 
 elsif ($SCHEMAS_STYLE_ARG && @ARGV > 2) 
 {
         &preparation;
         &print_message;
         &schemas_merge_translations;
-	&finalize;
+        &finalize;
 } 
 elsif ($RFC822DEB_STYLE_ARG && @ARGV > 2) 
 {
         &preparation;
         &print_message;
         &rfc822deb_merge_translations;
-	&finalize;
+        &finalize;
 } 
 else 
 {
-	&print_help;
+        &print_help;
 }
 
 exit;
@@ -213,7 +202,7 @@ Other options:
   -p, --pass-through     use strings as found in .po files, without
                          conversion (STRONGLY unrecommended with -x)
   -m, --multiple-output  output one localized file per locale, instead of 
-	                 a single file containing all localized elements
+                         a single file containing all localized elements
   -c, --cache=FILE       specify cache file name
                          (usually \$top_builddir/po/.intltool-merge-cache)
   -q, --quiet            suppress most messages
@@ -263,7 +252,7 @@ sub po_file2lang
 sub gather_po_files
 {
     for my $po_file (glob "$PO_DIR/*.po") {
-	$po_files_by_lang{po_file2lang($po_file)} = $po_file;
+        $po_files_by_lang{po_file2lang($po_file)} = $po_file;
     }
 }
 
@@ -276,7 +265,7 @@ sub get_local_charset
 
     if (open CHARSET_ALIAS, $alias_file) 
     {
-	while (<CHARSET_ALIAS>) 
+        while (<CHARSET_ALIAS>) 
         {
             next if /^\#/;
             return $1 if (/^\s*([-._a-zA-Z0-9]+)\s+$encoding\b/i)
@@ -315,7 +304,7 @@ sub get_po_encoding
 
     system ("$iconv -f $encoding -t UTF-8 </dev/null 2>/dev/null");
     if ($?) {
-	$encoding = get_local_charset($encoding);
+        $encoding = get_local_charset($encoding);
     }
 
     return $encoding
@@ -335,7 +324,7 @@ sub utf8_sanity_check 
 sub get_translation_database
 {
     if ($cache_file) {
-	&get_cached_translation_database;
+        &get_cached_translation_database;
     } else {
         &create_translation_database;
     }
@@ -347,8 +336,8 @@ sub get_newest_po_age
 
     foreach my $file (values %po_files_by_lang) 
     {
-	my $file_age = -M $file;
-	$newest_age = $file_age if !$newest_age || $file_age < $newest_age;
+        my $file_age = -M $file;
+        $newest_age = $file_age if !$newest_age || $file_age < $newest_age;
     }
 
     $newest_age = 0 if !$newest_age;
@@ -401,7 +390,7 @@ sub create_translation_database
 {
     for my $lang (keys %po_files_by_lang) 
     {
-    	my $po_file = $po_files_by_lang{$lang};
+        my $po_file = $po_files_by_lang{$lang};
 
         if ($UTF8_ARG) 
         {
@@ -409,60 +398,60 @@ sub create_translation_database
 
             if (lc $encoding eq "utf-8") 
             {
-                open PO_FILE, "<$po_file";	
+                open PO_FILE, "<$po_file";
             } 
             else 
             {
-		print STDERR "WARNING: $po_file is not in UTF-8 but $encoding, converting...\n" unless $QUIET_ARG;;
+                print STDERR "WARNING: $po_file is not in UTF-8 but $encoding, converting...\n" unless $QUIET_ARG;;
 
-                open PO_FILE, "$iconv -f $encoding -t UTF-8 $po_file|";	
+                open PO_FILE, "$iconv -f $encoding -t UTF-8 $po_file|";
             }
         } 
         else 
         {
-            open PO_FILE, "<$po_file";	
+            open PO_FILE, "<$po_file";
         }
 
-	my $nextfuzzy = 0;
-	my $inmsgid = 0;
-	my $inmsgstr = 0;
-	my $msgid = "";
-	my $msgstr = "";
+        my $nextfuzzy = 0;
+        my $inmsgid = 0;
+        my $inmsgstr = 0;
+        my $msgid = "";
+        my $msgstr = "";
 
         while (<PO_FILE>) 
         {
-	    $nextfuzzy = 1 if /^#, fuzzy/;
+            $nextfuzzy = 1 if /^#, fuzzy/;
        
-	    if (/^msgid "((\\.|[^\\])*)"/ ) 
+            if (/^msgid "((\\.|[^\\])*)"/ ) 
             {
-		$translations{$lang, $msgid} = $msgstr if $inmsgstr && $msgid && $msgstr;
-		$msgid = "";
-		$msgstr = "";
-
-		if ($nextfuzzy) {
-		    $inmsgid = 0;
-		} else {
-		    $msgid = unescape_po_string($1);
-		    $inmsgid = 1;
-		}
-		$inmsgstr = 0;
-		$nextfuzzy = 0;
-	    }
+                $translations{$lang, $msgid} = $msgstr if $inmsgstr && $msgid && $msgstr;
+                $msgid = "";
+                $msgstr = "";
+
+                if ($nextfuzzy) {
+                    $inmsgid = 0;
+                } else {
+                    $msgid = unescape_po_string($1);
+                    $inmsgid = 1;
+                }
+                $inmsgstr = 0;
+                $nextfuzzy = 0;
+            }
 
-	    if (/^msgstr "((\\.|[^\\])*)"/) 
+            if (/^msgstr "((\\.|[^\\])*)"/) 
             {
-	        $msgstr = unescape_po_string($1);
-		$inmsgstr = 1;
-		$inmsgid = 0;
-	    }
+                $msgstr = unescape_po_string($1);
+                $inmsgstr = 1;
+                $inmsgid = 0;
+            }
 
-	    if (/^"((\\.|[^\\])*)"/) 
+            if (/^"((\\.|[^\\])*)"/) 
             {
-	        $msgid .= unescape_po_string($1) if $inmsgid;
-	        $msgstr .= unescape_po_string($1) if $inmsgstr;
-	    }
-	}
-	$translations{$lang, $msgid} = $msgstr if $inmsgstr && $msgid && $msgstr;
+                $msgid .= unescape_po_string($1) if $inmsgid;
+                $msgstr .= unescape_po_string($1) if $inmsgstr;
+            }
+        }
+        $translations{$lang, $msgid} = $msgstr if $inmsgstr && $msgid && $msgstr;
     }
 }
 
@@ -524,7 +513,7 @@ sub entity_encode
     } 
     else 
     {
-	# with UTF-8 we only encode minimalistic
+        # with UTF-8 we only encode minimalistic
         return join ('', map (&entity_encode_int_minimalist, @list_of_chars));
     }
 }
@@ -543,11 +532,11 @@ sub entity_encode_int_even_high_bit
     if ($_ > 127 || $_ == 34 || $_ == 38 || $_ == 39 || $_ == 60) 
     {
         # the ($_ > 127) should probably be removed
-	return "&#" . $_ . ";"; 
+        return "&#" . $_ . ";"; 
     } 
     else 
     {
-	return chr $_;
+        return chr $_;
     }
 }
 
@@ -583,26 +572,26 @@ sub ba_merge_translations
 
         my @strings = ();
         $_ = $node;
-	while (s/(\s)_($w+\s*=\s*"($q)")/$1$2/s) {
+        while (s/(\s)_($w+\s*=\s*"($q)")/$1$2/s) {
              push @strings, entity_decode($3);
         }
-	print OUTPUT;
+        print OUTPUT;
 
-	my %langs;
-	for my $string (@strings) 
+        my %langs;
+        for my $string (@strings) 
         {
-	    for my $lang (keys %po_files_by_lang) 
+            for my $lang (keys %po_files_by_lang) 
             {
                 $langs{$lang} = 1 if $translations{$lang, $string};
-	    }
-	}
-	
-	for my $lang (sort keys %langs) 
+            }
+        }
+
+        for my $lang (sort keys %langs) 
         {
-	    $_ = $node;
-	    s/(\sname\s*=\s*)"($q)"/$1"$2-$lang"/s;
-	    s/(\s)_($w+\s*=\s*")($q)"/$1 . $2 . entity_encoded_translation($lang, $3) . '"'/seg;
-	    print OUTPUT;
+            $_ = $node;
+            s/(\sname\s*=\s*)"($q)"/$1"$2-$lang"/s;
+            s/(\s)_($w+\s*=\s*")($q)"/$1 . $2 . entity_encoded_translation($lang, $3) . '"'/seg;
+            print OUTPUT;
         }
     }
 
@@ -883,6 +872,56 @@ sub parseTree
     }
 }
 
+sub intltool_tree_char
+{
+    my $expat = shift;
+    my $text  = shift;
+    my $clist = $expat->{Curlist};
+    my $pos   = $#$clist;
+
+    # Use original_string so that we retain escaped entities
+    # in CDATA sections.
+    #
+    if ($pos > 0 and $clist->[$pos - 1] eq '0') {
+        $clist->[$pos] .= $expat->original_string();
+    } else {
+        push @$clist, 0 => $expat->original_string();
+    }
+}
+
+sub intltool_tree_start
+{
+    my $expat    = shift;
+    my $tag      = shift;
+    my @origlist = ();
+
+    # Use original_string so that we retain escaped entities
+    # in attribute values.  We must convert the string to an
+    # @origlist array to conform to the structure of the Tree
+    # Style.
+    #
+    my @original_array = split /\x/, $expat->original_string();
+    my $source         = $expat->original_string();
+
+    # Remove leading tag.
+    #
+    $source =~ s|^[ \t]*<[ \t]*(\S+)||s;
+
+    # Grab attribute key/value pairs and push onto @origlist array.
+    #
+    while ($source =~ s|^[ \t]*([\w:]+)[ \t]*[=][ \t]*["]([^"]*)["]||s)
+    {
+       push @origlist, $1;
+       push @origlist, $2;
+    }
+
+    my $ol = [ { @origlist } ];
+
+    push @{ $expat->{Lists} }, $expat->{Curlist};
+    push @{ $expat->{Curlist} }, $tag => $ol;
+    $expat->{Curlist} = $ol;
+}
+
 sub readXml
 {
     my $filename = shift || return;
@@ -890,7 +929,9 @@ sub readXml
         die "ERROR Cannot find filename: $filename\n";
     }
 
-    my $xp = new XML::Parser(Style => 'XML::Parser::Style::OrigTree');
+    my $xp = new XML::Parser(Style => 'Tree');
+    $xp->setHandlers(Char => \&intltool_tree_char);
+    $xp->setHandlers(Start => \&intltool_tree_start);
     my $tree = $xp->parsefile($filename);
 
 # <foo><head id="a">Hello <em>there</em></head><bar>Howdy<ref/></bar>do</foo>
@@ -901,18 +942,45 @@ sub readXml
     return $tree;
 }
 
+sub print_header
+{
+    my $infile = shift;
+    my $fh = shift;
+    my $source;
+
+    if(!-f $infile) {
+        die "ERROR Cannot find filename: $infile\n";
+    }
+
+    print $fh qq{<?xml version="1.0" encoding="UTF-8"?>\n};
+    {
+        local $/;
+        open DOCINPUT, "<${FILE}" or die;
+        $source = <DOCINPUT>;
+        close DOCINPUT;
+    }
+    if ($source =~ /(<!DOCTYPE.*\[.*\]\s*>)/s)
+    {
+        print $fh "$1\n";
+    }
+    elsif ($source =~ /(<!DOCTYPE.*>)/s)
+    {
+        print $fh "$1\n";
+    }
+}
+
 sub xml_merge_output
 {
     my $source;
 
     if ($MULTIPLE_OUTPUT) {
         for my $lang (sort keys %po_files_by_lang) {
-	    if ( ! -e $lang ) {
-	        mkdir $lang or die "Cannot create subdirectory $lang: $!\n";
+            if ( ! -e $lang ) {
+                mkdir $lang or die "Cannot create subdirectory $lang: $!\n";
             }
             open OUTPUT, ">$lang/$OUTFILE" or die "Cannot open $lang/$OUTFILE: $!\n";
             my $tree = readXml($FILE);
-            print OUTPUT qq{<?xml version="1.0" encoding="UTF-8"?>\n};
+            print_header($FILE, \*OUTPUT);
             parseTree(\*OUTPUT, $tree, 0, $lang);
             close OUTPUT;
             print "CREATED $lang/$OUTFILE\n" unless $QUIET_ARG;
@@ -920,7 +988,7 @@ sub xml_merge_output
     } 
     open OUTPUT, ">$OUTFILE" or die "Cannot open $OUTFILE: $!\n";
     my $tree = readXml($FILE);
-    print OUTPUT qq{<?xml version="1.0" encoding="UTF-8"?>\n};
+    print_header($FILE, \*OUTPUT);
     parseTree(\*OUTPUT, $tree, 0);
     close OUTPUT;
     print "CREATED $OUTFILE\n" unless $QUIET_ARG;
@@ -935,22 +1003,22 @@ sub keys_merge_translations
     {
         if (s/^(\s*)_(\w+=(.*))/$1$2/)  
         {
-	    my $string = $3;
+            my $string = $3;
 
             print OUTPUT;
 
-	    my $non_translated_line = $_;
+            my $non_translated_line = $_;
 
             for my $lang (sort keys %po_files_by_lang) 
             {
-		my $translation = $translations{$lang, $string};
+                my $translation = $translations{$lang, $string};
                 next if !$translation;
 
                 $_ = $non_translated_line;
-		s/(\w+)=.*/[$lang]$1=$translation/;
+                s/(\w+)=.*/[$lang]$1=$translation/;
                 print OUTPUT;
             }
-	} 
+        } 
         else 
         {
             print OUTPUT;
@@ -970,11 +1038,11 @@ sub desktop_merge_translations
     {
         if (s/^(\s*)_(\w+=(.*))/$1$2/)  
         {
-	    my $string = $3;
+            my $string = $3;
 
             print OUTPUT;
 
-	    my $non_translated_line = $_;
+            my $non_translated_line = $_;
 
             for my $lang (sort keys %po_files_by_lang) 
             {
@@ -985,7 +1053,7 @@ sub desktop_merge_translations
                 s/(\w+)=.*/${1}[$lang]=$translation/;
                 print OUTPUT;
             }
-	} 
+        } 
         else 
         {
             print OUTPUT;
@@ -1026,63 +1094,63 @@ sub schemas_merge_translations
     {
         print OUTPUT $1;
 
-	my $locale_start_spaces = $2 ? $2 : '';
-	my $default_spaces = $4 ? $4 : '';
-	my $short_spaces = $7 ? $7 : '';
-	my $long_spaces = $10 ? $10 : '';
-	my $locale_end_spaces = $13 ? $13 : '';
-	my $c_default_block = $3 ? $3 : '';
-	my $default_string = $6 ? $6 : '';
-	my $short_string = $9 ? $9 : '';
-	my $long_string = $12 ? $12 : '';
+        my $locale_start_spaces = $2 ? $2 : '';
+        my $default_spaces = $4 ? $4 : '';
+        my $short_spaces = $7 ? $7 : '';
+        my $long_spaces = $10 ? $10 : '';
+        my $locale_end_spaces = $13 ? $13 : '';
+        my $c_default_block = $3 ? $3 : '';
+        my $default_string = $6 ? $6 : '';
+        my $short_string = $9 ? $9 : '';
+        my $long_string = $12 ? $12 : '';
 
-	$c_default_block =~ s/default>\[.*?\]/default>/s;
+        $c_default_block =~ s/default>\[.*?\]/default>/s;
         
-	print OUTPUT "$locale_start_spaces$c_default_block";
+        print OUTPUT "$locale_start_spaces$c_default_block";
 
         $default_string =~ s/\s+/ /g;
         $default_string = entity_decode($default_string);
-	$short_string =~ s/\s+/ /g;
-	$short_string = entity_decode($short_string);
-	$long_string =~ s/\s+/ /g;
-	$long_string = entity_decode($long_string);
+        $short_string =~ s/\s+/ /g;
+        $short_string = entity_decode($short_string);
+        $long_string =~ s/\s+/ /g;
+        $long_string = entity_decode($long_string);
 
-	for my $lang (sort keys %po_files_by_lang) 
+        for my $lang (sort keys %po_files_by_lang) 
         {
-	    my $default_translation = $translations{$lang, $default_string};
-	    my $short_translation = $translations{$lang, $short_string};
-	    my $long_translation  = $translations{$lang, $long_string};
+            my $default_translation = $translations{$lang, $default_string};
+            my $short_translation = $translations{$lang, $short_string};
+            my $long_translation  = $translations{$lang, $long_string};
 
-	    next if (!$default_translation && !$short_translation && 
+            next if (!$default_translation && !$short_translation && 
                      !$long_translation);
 
-	    print OUTPUT "\n$locale_start_spaces<locale name=\"$lang\">";
+            print OUTPUT "\n$locale_start_spaces<locale name=\"$lang\">";
 
-        print OUTPUT "$default_spaces";    
+            print OUTPUT "$default_spaces";    
 
-        if ($default_translation)
-        {
-            $default_translation = entity_encode($default_translation);
-            print OUTPUT "<default>$default_translation</default>";
-        }
+            if ($default_translation)
+            {
+                $default_translation = entity_encode($default_translation);
+                print OUTPUT "<default>$default_translation</default>";
+            }
 
-	    print OUTPUT "$short_spaces";
+            print OUTPUT "$short_spaces";
 
-	    if ($short_translation)
-	    {
-			$short_translation = entity_encode($short_translation);
-			print OUTPUT "<short>$short_translation</short>";
-	    }
-
-	    print OUTPUT "$long_spaces";
-
-	    if ($long_translation)
-	    {
-			$long_translation = entity_encode($long_translation);
-			print OUTPUT "<long>$long_translation</long>";
-	    }	    
+            if ($short_translation)
+            {
+                $short_translation = entity_encode($short_translation);
+                print OUTPUT "<short>$short_translation</short>";
+            }
+
+            print OUTPUT "$long_spaces";
+
+            if ($long_translation)
+            {
+                $long_translation = entity_encode($long_translation);
+                print OUTPUT "<long>$long_translation</long>";
+            }
 
-	    print OUTPUT "$locale_end_spaces</locale>";
+            print OUTPUT "$locale_end_spaces</locale>";
         }
     }
 
@@ -1108,67 +1176,67 @@ sub rfc822deb_merge_translations
 
     while ($source =~ /(^|\n+)(_)?([^:_\n]+)(:\s*)(.*?)(?=\n[\S\n]|$)/sg) 
     {
-	    my $sep = $1;
-	    my $non_translated_line = $3.$4;
-	    my $string = $5;
-	    my $is_translatable = defined($2);
-	    #  Remove [] dummy strings
-	    $string =~ s/\[\s[^\[\]]*\]$//;
-            $non_translated_line .= $string;
+        my $sep = $1;
+        my $non_translated_line = $3.$4;
+        my $string = $5;
+        my $is_translatable = defined($2);
+        #  Remove [] dummy strings
+        $string =~ s/\[\s[^\[\]]*\]$//;
+        $non_translated_line .= $string;
 
-            print OUTPUT $sep.$non_translated_line;
-    
-            if ($is_translatable) 
+        print OUTPUT $sep.$non_translated_line;
+
+        if ($is_translatable) 
+        {
+            my @str_list = rfc822deb_split($string);
+       
+            for my $lang (sort keys %po_files_by_lang) 
             {
-                my @str_list = rfc822deb_split($string);
-           
-	        for my $lang (sort keys %po_files_by_lang) 
+                my $is_translated = 1;
+                my $str_translated = '';
+                my $first = 1;
+            
+                for my $str (@str_list) 
                 {
-                    my $is_translated = 1;
-                    my $str_translated = '';
-                    my $first = 1;
-                
-                    for my $str (@str_list) 
-                    {
-                        my $translation = $translations{$lang, $str};
-                    
-                        if (!$translation) 
-                        {
-                            $is_translated = 0;
-                            last;
-                        }
-
-	                #  $translation may also contain [] dummy
-                        #  strings, mostly to indicate an empty string
-	                $translation =~ s/\[\s[^\[\]]*\]$//;
-                        
-                        if ($first) 
-                        {
-                            $str_translated .=
-                                Text::Tabs::expand($translation) .
-                                "\n";
-                        } 
-                        else 
-                        {
-                            $str_translated .= Text::Tabs::expand(
-                                Text::Wrap::wrap(' ', ' ', $translation)) .
-                                "\n .\n";
-                        }
-                        $first = 0;
+                    my $translation = $translations{$lang, $str};
 
-                        #  To fix some problems with Text::Wrap::wrap
-                        $str_translated =~ s/(\n )+\n/\n .\n/g;
+                    if (!$translation) 
+                    {
+                        $is_translated = 0;
+                        last;
                     }
-                    next unless $is_translated;
 
-                    $str_translated =~ s/\n \.\n$//;
-                    $str_translated =~ s/\s+$//;
+                    #  $translation may also contain [] dummy
+                    #  strings, mostly to indicate an empty string
+                    $translation =~ s/\[\s[^\[\]]*\]$//;
+                    
+                    if ($first) 
+                    {
+                        $str_translated .=
+                            Text::Tabs::expand($translation) .
+                            "\n";
+                    } 
+                    else 
+                    {
+                        $str_translated .= Text::Tabs::expand(
+                            Text::Wrap::wrap(' ', ' ', $translation)) .
+                            "\n .\n";
+                    }
+                    $first = 0;
 
-                    $_ = $non_translated_line;
-                    s/^(\w+):\s*.*/$sep${1}-$lang: $str_translated/s;
-                    print OUTPUT;
+                    #  To fix some problems with Text::Wrap::wrap
+                    $str_translated =~ s/(\n )+\n/\n .\n/g;
                 }
+                next unless $is_translated;
+
+                $str_translated =~ s/\n \.\n$//;
+                $str_translated =~ s/\s+$//;
+
+                $_ = $non_translated_line;
+                s/^(\w+):\s*.*/$sep${1}-$lang: $str_translated/s;
+                print OUTPUT;
             }
+        }
     }
     print OUTPUT "\n";
 
Index: intltoolize.in
===================================================================
RCS file: /cvs/gnome/intltool/intltoolize.in,v
retrieving revision 1.15
diff -u -p -r1.15 intltoolize.in
--- intltoolize.in	6 Dec 2003 13:22:58 -0000	1.15
+++ intltoolize.in	18 Dec 2003 19:06:28 -0000
@@ -142,7 +142,6 @@ fi
 
 
 files='intltool-extract.in intltool-merge.in intltool-update.in'
-deep_files='XML/Parser/Style/OrigTree.pm'
 
 auxdir=.
 auxdirline=`egrep '^AC_CONFIG_AUX_DIR' $configure 2>/dev/null`
@@ -251,24 +250,6 @@ if test ! -d intltool-modules; then
   fi
 fi
 cd intltool-modules || exit 1
-
-for file in $deep_files; do
-  if test -f "$file" && test -z "$force"; then
-    test -z "$automake" && echo "$progname: '$file' exists: use '--force' to overwrite" 1>&2
-    continue
-  fi
-
-  dirname=`echo x$file | sed 's%^x\(.*/\).*$%\1%'`
-  $rm_rec $file
-  if $cur/$mkinstalldirs $dirname; then
-    if test -n "$ln_s" && $ln_s $pkgdatadir/$file $dirname; then :
-    elif $cp $pkgdatadir/$file $dirname; then :
-    else
-      echo "$progname: cannot copy '$pkgdatadir/$file' to '$dirname'" 1>&2
-      status=1
-    fi
-  fi
-done
 )
 
 # FIXME: This probably does not work w/ builddir != srcdir because it
Index: tests/cases/merge6.xml.in
===================================================================
RCS file: /cvs/gnome/intltool/tests/cases/merge6.xml.in,v
retrieving revision 1.2
diff -u -p -r1.2 merge6.xml.in
--- tests/cases/merge6.xml.in	19 Aug 2001 07:43:19 -0000	1.2
+++ tests/cases/merge6.xml.in	18 Dec 2003 19:06:28 -0000
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<foo>
+<foo value="&lt;!DOCTYPE\ xbel">
   <_bar>This is a &quot; test</_bar>
   <_bar>This is another ' test</_bar>
 </foo>
Index: tests/results/merge6.xml
===================================================================
RCS file: /cvs/gnome/intltool/tests/results/merge6.xml,v
retrieving revision 1.7
diff -u -p -r1.7 merge6.xml
--- tests/results/merge6.xml	11 Dec 2003 10:34:15 -0000	1.7
+++ tests/results/merge6.xml	18 Dec 2003 19:06:28 -0000
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<foo>
+<foo value="&lt;!DOCTYPE\ xbel">
   <bar>This is a &quot; test</bar>
   <bar>This is another ' test</bar>
   <bar xml:lang="merge6">This is &apos; another \ test, and a \0123uccess.</bar>
