Index: intltool-extract.in.in
===================================================================
RCS file: /cvs/gnome/intltool/intltool-extract.in.in,v
retrieving revision 1.58
diff -u -r1.58 intltool-extract.in.in
--- intltool-extract.in.in	14 Jun 2004 09:13:10 -0000	1.58
+++ intltool-extract.in.in	14 Jun 2004 12:04:22 -0000
@@ -266,11 +266,12 @@
 sub type_xml {
     ### For generic translatable XML files ###
         
-    while ($input =~ /\s_$w+\s*=\s*\"([^"]+)\"/sg) { # "
-        $messages{entity_decode_minimal($1)} = [];
+    while ($input =~ /(?:<!--([^>]*?)-->[^\n]*\n?[^\n]*)?\s_$w+\s*=\s*\"([^"]+)\"/sg) { # "
+        $messages{entity_decode_minimal($2)} = [];
+        $comments{entity_decode_minimal($2)} = $1 if (defined($1));
     }
 
-    while ($input =~ /(?:<!--([^>]*?)-->\s*)?<_($w+)(?: xml:space="($w+)")?>(.+?)<\/_\2>/sg) {
+    while ($input =~ /(?:<!--([^>]*?)-->\s*)?<_($w+)(?: xml:space="($w+)")?[^>]*>(.+?)<\/_\2>/sg) {
         $_ = $4;
         if (!defined($3) || $3 ne "preserve") {
             s/\s+/ /g;
Index: tests/results/extract-comments.xml.h
===================================================================
RCS file: /cvs/gnome/intltool/tests/results/extract-comments.xml.h,v
retrieving revision 1.1
diff -u -r1.1 extract-comments.xml.h
--- tests/results/extract-comments.xml.h	6 May 2004 16:24:29 -0000	1.1
+++ tests/results/extract-comments.xml.h	14 Jun 2004 12:04:28 -0000
@@ -8,3 +8,10 @@
      second line of multi-line comment  */
 char *s = N_("Something to translate");
 char *s = N_("This doesn't have a comment for translators");
+/*  Comment for *both* attributes and content  */
+char *s = N_("attribute value");
+/*  This comment will appear if attributes can be commented about  */
+char *s = N_("attribute with comment");
+char *s = N_("attribute without comment");
+/*  Comment for *both* attributes and content  */
+char *s = N_("even more content");
Index: extract-comments.xml
===================================================================
RCS file: /cvs/gnome/intltool/tests/cases/extract-comments.xml,v
retrieving revision 1.1
diff -u -r1.1 extract-comments.xml
--- extract-comments.xml	6 May 2004 16:24:29 -0000	1.1
+++ extract-comments.xml	14 Jun 2004 12:10:22 -0000
@@ -20,4 +20,12 @@
 sign in it, but the following string isn't -->
 <_translate>Dum-dee-dum</_translate>
 
+<tagnotmarked _markedattribute="attribute without comment">some content</tagnotmarked>
+
+<!-- This comment will appear if attributes can be commented about -->
+<tagnotmarked _markedattribute="attribute with comment">more content</tagnotmarked>
+
+<!-- Comment for *both* attributes and content -->
+<_translate _markedattribute="attribute value">even more content</_translate>
+
 </dummy>
