| Module | REXML::Namespace |
| In: |
lib/rexml/namespace.rb
|
Adds named attributes to an object.
| NAMESPLIT | = | /^(?:(#{NCNAME_STR}):)?(#{NCNAME_STR})/u |
| name | -> | local_name |
| expanded_name | [R] | The name of the object, valid if set |
| name | [R] | The name of the object, valid if set |
| prefix | [RW] | The expanded name of the object, valid if name is set |
Fully expand the name, even if the prefix wasn‘t specified in the source file.
# File lib/rexml/namespace.rb, line 41
41: def fully_expanded_name
42: ns = prefix
43: return "#{ns}:#@name" if ns.size > 0
44: return @name
45: end
Compares names optionally WITH namespaces
# File lib/rexml/namespace.rb, line 27
27: def has_name?( other, ns=nil )
28: if ns
29: return (namespace() == ns and name() == other)
30: elsif other.include? ":"
31: return fully_expanded_name == other
32: else
33: return name == other
34: end
35: end