Moved default namespace into Oga::XML
The default namespace is now located at Oga::XML::DEFAULT_NAMESPACE instead of Oga::XML::Attribute::DEFAULT_NAMESPACE.
This commit is contained in:
parent
5802d9d62c
commit
68ada997a8
|
@ -34,6 +34,7 @@ require_relative 'oga/xml/xml_declaration'
|
||||||
require_relative 'oga/xml/processing_instruction'
|
require_relative 'oga/xml/processing_instruction'
|
||||||
require_relative 'oga/xml/doctype'
|
require_relative 'oga/xml/doctype'
|
||||||
require_relative 'oga/xml/namespace'
|
require_relative 'oga/xml/namespace'
|
||||||
|
require_relative 'oga/xml/default_namespace'
|
||||||
require_relative 'oga/xml/attribute'
|
require_relative 'oga/xml/attribute'
|
||||||
require_relative 'oga/xml/element'
|
require_relative 'oga/xml/element'
|
||||||
require_relative 'oga/xml/node_set'
|
require_relative 'oga/xml/node_set'
|
||||||
|
|
|
@ -21,17 +21,6 @@ module Oga
|
||||||
class Attribute
|
class Attribute
|
||||||
attr_accessor :name, :namespace_name, :element, :value
|
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 => 'http://www.w3.org/XML/1998/namespace'
|
|
||||||
).freeze
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# @param [Hash] options
|
# @param [Hash] options
|
||||||
#
|
#
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
module Oga
|
||||||
|
module XML
|
||||||
|
##
|
||||||
|
# The default XML namespace.
|
||||||
|
#
|
||||||
|
# @return [Oga::XML::Namespace]
|
||||||
|
#
|
||||||
|
DEFAULT_NAMESPACE = Namespace.new(
|
||||||
|
:name => 'xml',
|
||||||
|
:uri => 'http://www.w3.org/XML/1998/namespace'
|
||||||
|
).freeze
|
||||||
|
end # XML
|
||||||
|
end # Oga
|
|
@ -33,7 +33,7 @@ describe Oga::XML::Attribute do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns the default XML namespace when the "xml" prefix is used' do
|
it 'returns the default XML namespace when the "xml" prefix is used' do
|
||||||
@default.namespace.should == Oga::XML::Attribute::DEFAULT_NAMESPACE
|
@default.namespace.should == Oga::XML::DEFAULT_NAMESPACE
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue