Author: rhs
Date: Mon Oct 6 13:53:53 2008
New Revision: 702258
URL: http://svn.apache.org/viewvc?rev=702258&view=rev
Log:
workaround for bug in REXML xpath impl
Modified:
incubator/qpid/trunk/qpid/cpp/rubygen/amqpgen.rb
Modified: incubator/qpid/trunk/qpid/cpp/rubygen/amqpgen.rb
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/rubygen/amqpgen.rb?rev=702258&r1=702257&r2=702258&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/rubygen/amqpgen.rb (original)
+++ incubator/qpid/trunk/qpid/cpp/rubygen/amqpgen.rb Mon Oct 6 13:53:53 2008
@@ -333,7 +333,14 @@
def initialize(xml,amqp) super; end
amqp_child_reader :implement, :field, :response
amqp_attr_reader :code
- def implement?(role) xml.elements["./[EMAIL PROTECTED]'#{role}']"] end
+ def implement?(role)
+ # we can't use xpath for this because it triggers a bug in some
+ # versions of ruby, including version 1.8.6.110
+ xml.elements.each {|el|
+ return true if el.name == "implement" and el.attributes["role"] == role
+ }
+ return false
+ end
def received_by?(client_or_server)
return (implement?(client_or_server) or implement?("sender") or
implement?("receiver"))
end