Distinguish default attribute/element namespaces
The previous commit messed this up because I wasn't fully awake.
This commit is contained in:
parent
68ada997a8
commit
f2d69af33b
|
@ -21,6 +21,17 @@ module Oga
|
|||
class Attribute
|
||||
attr_accessor :name, :namespace_name, :element, :value
|
||||
|
||||
##
|
||||
# The default namespace available to all attributes. This namespace can
|
||||
# not be modified.
|
||||
#
|
||||
# @return [Oga::XML::Namespace]
|
||||
#
|
||||
DEFAULT_NAMESPACE = Namespace.new(
|
||||
:name => 'xml',
|
||||
:uri => XML::DEFAULT_NAMESPACE.uri
|
||||
).freeze
|
||||
|
||||
##
|
||||
# @param [Hash] options
|
||||
#
|
||||
|
|
|
@ -6,7 +6,7 @@ module Oga
|
|||
# @return [Oga::XML::Namespace]
|
||||
#
|
||||
DEFAULT_NAMESPACE = Namespace.new(
|
||||
:name => 'xml',
|
||||
:name => 'xmlns',
|
||||
:uri => 'http://www.w3.org/XML/1998/namespace'
|
||||
).freeze
|
||||
end # XML
|
||||
|
|
|
@ -33,7 +33,7 @@ describe Oga::XML::Attribute do
|
|||
end
|
||||
|
||||
it 'returns the default XML namespace when the "xml" prefix is used' do
|
||||
@default.namespace.should == Oga::XML::DEFAULT_NAMESPACE
|
||||
@default.namespace.should == Oga::XML::Attribute::DEFAULT_NAMESPACE
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue