Skip to content

Commit 3504138

Browse files
author
Terry Reese
committed
updated libxml to use new method for accessing a property from a node. Corrected error code retrieval when using libxml
1 parent 2cd1b2d commit 3504138

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

Changes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
v0.0.12 Monday Dec. 23
2+
- libxml is deprecating node.property, so added support to new syntax to xpath.rb
3+
14
v0.0.11 Monday Sept. 15
25
- fixed problem in client/response dealing with libxml call that was missed during recent libxml .5+ support corrections.
36
- Thank you to Bjorn Hjelle for pointing out the above oversight.

README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,4 @@ Where x.y.z is the version of the gem that was generated.
7878

7979
- Ed Summers <[email protected]>
8080
- William Groppe <[email protected]>
81+
- Terry Reese <[email protected]>

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
RUBY_OAI_VERSION = '0.0.11'
1+
RUBY_OAI_VERSION = '0.0.12'
22

33
require 'rubygems'
44
require 'rake'

lib/oai/client/response.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ def initialize(doc)
2121
if defined?(error.property) == nil
2222
code = error.attributes['code']
2323
else
24-
code.property('code')
24+
begin
25+
code = error["code"]
26+
rescue
27+
code = error.property('code')
28+
end
2529
end
2630
end
2731
raise OAI::Exception.new(message, code)

lib/oai/xpath.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ def get_attribute(node, attr_name)
4242
if defined?(node.property) == nil
4343
return node.attributes[attr_name]
4444
else
45-
return node.property(attr_name)
45+
#node.property is being deprecated. We'll eventually remove
46+
#this trap
47+
begin
48+
return node[attr_name]
49+
rescue
50+
return node.property(attr_name)
51+
end
4652
end
4753
end
4854
return nil

0 commit comments

Comments
 (0)