|
def initialize( first, second=nil, parent=nil )
@element = nil
@normalized = true
if first.kind_of? Attribute
self.name = first.expanded_name
@value = first.value
if second.kind_of? Element
@element = second
else
@element = first.element
end
elsif first.kind_of? String
@element = parent if parent.kind_of? Element
self.name = first
@value = second
@normalized = false
elsif first.kind_of? Source
@element = second if second.kind_of? Element
md = first.match(PATTERN, true )
self.name, @value = md[1],md[3]
else
raise "illegal argument #{first.type} to Attribute constructor"
end
end
|