diff options
author | Ville Skytt? <ville.skytta@iki.fi> | 2010-06-29 23:35:06 +0300 |
---|---|---|
committer | Ville Skytt? <ville.skytta@iki.fi> | 2010-06-29 23:35:06 +0300 |
commit | d3db7d381cf4245785780acf362a7614274c4a3d (patch) | |
tree | 875e2cc657491a284169c019977679dcf51f2919 | |
parent | 4a3190abf2d9eb30db2fe312455e24e1b5130a8d (diff) | |
download | markup-validator-d3db7d381cf4245785780acf362a7614274c4a3d.zip markup-validator-d3db7d381cf4245785780acf362a7614274c4a3d.tar.gz markup-validator-d3db7d381cf4245785780acf362a7614274c4a3d.tar.bz2 |
Call is_xml() less.
-rwxr-xr-x | httpd/cgi-bin/check | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index d6f69d2..63e39c8 100755 --- a/httpd/cgi-bin/check +++ b/httpd/cgi-bin/check @@ -3391,25 +3391,25 @@ sub start_element 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 = ""; - - # Try with SAX method - if ($attr->{Value}) { - $has_xmlns = TRUE; - $xmlns_value = $attr->{Value}; - } + if ((my $attr = $element->{Attributes}->{xmlns}) && + &W3C::Validator::MarkupValidator::is_xml($self->{_file})) + { + $xmlns_value = ""; - #next if $has_xmlns; + # Try with SAX method + if ($attr->{Value}) { + $has_xmlns = TRUE; + $xmlns_value = $attr->{Value}; + } - # 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}}); - } + #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}}); } } |