13
0
livetrax/libs/surfaces/mackie/scripts/transform.rb
Paul Davis 45d3ec1437 merged with 1697 revision of trunk (which is post-rc1 but pre-rc2
git-svn-id: svn://localhost/ardour2/branches/2.1-staging@1698 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-04-11 13:07:51 +00:00

27 lines
540 B
Ruby

class ElementHandler
def apply( anElement )
anElement.each {|e| handle(e)} if anElement
end
def handle( aNode )
if aNode.kind_of? REXML::Text
handleTextNode(aNode)
elsif aNode.kind_of? REXML::Element
handle_element aNode
else
return #ignore comments and processing instructions
end
end
def handle_element( anElement )
handler_method = "handle_" + anElement.name.tr("-","_")
if self.respond_to? handler_method
self.send(handler_method, anElement)
else
default_handler(anElement)
end
end
end