summaryrefslogtreecommitdiff
path: root/qpid/cpp/rubygen
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2008-10-06 20:53:53 +0000
committerRafael H. Schloming <rhs@apache.org>2008-10-06 20:53:53 +0000
commite4acc5c457a5e9a5ffb86921ca1dc36fbcad1c4e (patch)
tree7e069182fe727594bfd86f1aaef221005c25a05e /qpid/cpp/rubygen
parent5e8d10689746fcfd640ea35a29e71a8cec26a992 (diff)
downloadqpid-python-e4acc5c457a5e9a5ffb86921ca1dc36fbcad1c4e.tar.gz
workaround for bug in REXML xpath impl
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@702258 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/rubygen')
-rwxr-xr-xqpid/cpp/rubygen/amqpgen.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/qpid/cpp/rubygen/amqpgen.rb b/qpid/cpp/rubygen/amqpgen.rb
index 04c840ea97..80542ebc77 100755
--- a/qpid/cpp/rubygen/amqpgen.rb
+++ b/qpid/cpp/rubygen/amqpgen.rb
@@ -333,7 +333,14 @@ class AmqpAction < AmqpElement
def initialize(xml,amqp) super; end
amqp_child_reader :implement, :field, :response
amqp_attr_reader :code
- def implement?(role) xml.elements["./implement[@role='#{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