W3C home > Mailing lists > Public > www-validator-cvs@w3.org > June 2010

markup-validator commit: Call is_xml() less.

From: Mercurial notifier <nobody@w3.org>
Date: Tue, 29 Jun 2010 20:35:16 +0000
To: markup-validator updates <www-validator-cvs@w3.org>
Message-Id: <E1OThWW-0001tB-7h@blinky.w3.org>
changeset:   3108:fcaa0daa54c2
tag:         tip
user:        Ville Skyttä <ville.skytta@iki.fi>
date:        Tue Jun 29 23:35:06 2010 +0300
files:       httpd/cgi-bin/check
description:
Call is_xml() less.


diff -r f7494ae35248 -r fcaa0daa54c2 httpd/cgi-bin/check
--- a/httpd/cgi-bin/check	Tue Jun 29 21:42:45 2010 +0300
+++ b/httpd/cgi-bin/check	Tue Jun 29 23:35:06 2010 +0300
@@ -3391,25 +3391,25 @@
     my $xmlns_value = undef;
 
     # If in XML mode, find namespace used for each element.
-    if (&W3C::Validator::MarkupValidator::is_xml($self->{_file})) {
-        if (my $attr = $element->{Attributes}->{xmlns}) {
-            $xmlns_value = "";
+    if ((my $attr = $element->{Attributes}->{xmlns}) &&
+        &W3C::Validator::MarkupValidator::is_xml($self->{_file}))
+    {
+        $xmlns_value = "";
 
-            # Try with SAX method
-            if ($attr->{Value}) {
-                $has_xmlns   = TRUE;
-                $xmlns_value = $attr->{Value};
-            }
+        # Try with SAX method
+        if ($attr->{Value}) {
+            $has_xmlns   = TRUE;
+            $xmlns_value = $attr->{Value};
+        }
 
-            #next if $has_xmlns;
+        #next if $has_xmlns;
 
-            # The following is not SAX, but OpenSP specific.
-            my $defaulted = $attr->{Defaulted} || '';
-            if ($defaulted eq "specified") {
-                $has_xmlns = TRUE;
-                $xmlns_value .=
-                    join("", map { $_->{Data} } @{$attr->{CdataChunks}});
-            }
+        # The following is not SAX, but OpenSP specific.
+        my $defaulted = $attr->{Defaulted} || '';
+        if ($defaulted eq "specified") {
+            $has_xmlns = TRUE;
+            $xmlns_value .=
+                join("", map { $_->{Data} } @{$attr->{CdataChunks}});
         }
     }
 
Received on Tuesday, 29 June 2010 20:35:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:21 GMT