Index: lib/parser.pm
===================================================================
RCS file: /sources/public/CSS/CSS2.1-test-suite/lib/parser.pm,v
retrieving revision 1.2
diff -u -r1.2 parser.pm
--- lib/parser.pm	9 Aug 2006 05:22:34 -0000	1.2
+++ lib/parser.pm	22 Sep 2008 21:34:45 -0000
@@ -72,15 +72,22 @@
         my $value = shift @attrData;
         my $namePrefixed = $name;
         if ($expat->namespace($name)) {
-            prefix: foreach my $prefix ($expat->current_ns_prefixes) {
-                if ($expat->expand_ns_prefix($prefix) eq $expat->namespace($name)) {
-                    $namePrefixed = "$prefix:$namePrefixed";
-                    $prefixesUsed->{$prefix} = $expat->namespace($name);
-                    last prefix;
+            if ('http://www.w3.org/XML/1998/namespace' eq $expat->namespace($name)) {
+                $namePrefixed = 'xml:' . $namePrefixed;
+                $name = '{http://www.w3.org/XML/1998/namespace}' . $name;
+            }
+            else {
+                prefix: foreach my $prefix ($expat->current_ns_prefixes) {
+                    if ($expat->expand_ns_prefix($prefix) eq $expat->namespace($name)) {
+                        $namePrefixed = "$prefix:$namePrefixed";
+                        $prefixesUsed->{$prefix} = $expat->namespace($name);
+                        print $prefix;
+                        last prefix;
+                    }
                 }
+                $namespacesUsed->{$expat->namespace($name)} += 1;
+                $name = '{' . $expat->namespace($name) . '}' . $name;
             }
-            $namespacesUsed->{$expat->namespace($name)} += 1;
-            $name = '{' . $expat->namespace($name) . '}' . $name;
         }
         $attributes->{$name} = $value;
         $attributesPrefixed->{$namePrefixed} = $value;
Index: lib/html.pm
===================================================================
RCS file: /sources/public/CSS/CSS2.1-test-suite/lib/html.pm,v
retrieving revision 1.4
diff -u -r1.4 html.pm
--- lib/html.pm	7 Mar 2008 22:11:06 -0000	1.4
+++ lib/html.pm	22 Sep 2008 21:34:45 -0000
@@ -69,7 +69,9 @@
     my $output = '<';
     $output .= $node->{localName};
     foreach my $attribute (keys %{$node->{attributesPrefixed}}) {
-        $output .= " $attribute=\"" . stringAsHTML($node->{attributesPrefixed}->{$attribute}) . '"';
+        my $name = $attribute;
+        $name =~ s/^xml://;
+        $output .= " $name=\"" . stringAsHTML($node->{attributesPrefixed}->{$attribute}) . '"';
     }
     $output .= '>';
     return $output;

