markup-validator commit: Call is_xml() less.

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 UTC