File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,8 @@ class BaseParser
140
140
"apos" => [ /'/ , "'" , "'" , /'/ ]
141
141
}
142
142
143
+ XML_PREFIXED_NAMESPACE = "http://www.w3.org/XML/1998/namespace"
144
+
143
145
module Private
144
146
PEREFERENCE_PATTERN = /#{ PEREFERENCE } /um
145
147
TAG_PATTERN = /((?>#{ QNAME_STR } ))\s */um
@@ -185,7 +187,7 @@ def stream=( source )
185
187
@tags = [ ]
186
188
@stack = [ ]
187
189
@entities = [ ]
188
- @namespaces = { "xml" => "http://www.w3.org/XML/1998/namespace" }
190
+ @namespaces = { "xml" => XML_PREFIXED_NAMESPACE }
189
191
@namespaces_restore_stack = [ ]
190
192
end
191
193
@@ -790,7 +792,7 @@ def parse_attributes(prefixes)
790
792
@source . match ( /\s */um , true )
791
793
if prefix == "xmlns"
792
794
if local_part == "xml"
793
- if value != "http://www.w3.org/XML/1998/namespace"
795
+ if value != XML_PREFIXED_NAMESPACE
794
796
msg = "The 'xml' prefix must not be bound to any other namespace " +
795
797
"(http://www.w3.org/TR/REC-xml-names/#ns-decl)"
796
798
raise REXML ::ParseException . new ( msg , @source , self )
You can’t perform that action at this time.
0 commit comments