diff options
author | Rafael H. Schloming <rhs@apache.org> | 2008-10-06 20:53:53 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2008-10-06 20:53:53 +0000 |
commit | 17ecdd2cceed216b64edd5e4711428ed8446c371 (patch) | |
tree | 6177996866941750b28280a05452c1430beb07da /cpp/rubygen | |
parent | 6dc69c22a6053b43744c7beb780e69673d509a09 (diff) | |
download | qpid-python-17ecdd2cceed216b64edd5e4711428ed8446c371.tar.gz |
workaround for bug in REXML xpath impl
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@702258 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/rubygen')
-rwxr-xr-x | cpp/rubygen/amqpgen.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cpp/rubygen/amqpgen.rb b/cpp/rubygen/amqpgen.rb index 04c840ea97..80542ebc77 100755 --- a/cpp/rubygen/amqpgen.rb +++ b/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 |