I've looked a little more into this, and it does seem to be an issue
with the namespaces. As far as I can tell, PayResponse is the only
API call that I've used so far that uses namespaces anywhere except
for the root node.
Glancing at Response in Relax, I noticed that the is? method seems to
throw away the namespace, and that's the only method that deals with
namespaces at all.
From a general-purpose REST wrapper, I think being namespace ignorant
could be a major deficiency. For me, I'm more worried about the
ramifications for Remit in particular.
I've read a little on Hpricot, and it seems that its XPath searching
cannot handle namespaces, mainly because it was designed with HTML
parsing in mind, not XML. The underlying parser just treats them as
different elements. So
xml.at("ns3:TransactionResponse") will get me
what I want, but
xml.at("TransactionResponse") will always get me
nil. Plus, I'm not sure how the namespaces are chosen/assigned, so I
don't know for sure if it will always be "ns3" or if it changes.
Seeing as how this is an underlying deficiency of Hpricot and not
Relax, my first inclination would be to suggest ripping out Hpricot
and replacing it with REXML. It might not be as fast, but I'm fairly
certain it can handle namespaces (although not 100%). Further, Relax
looks very well encapsulated so that replacing Hpricot with REXML
would be a small, localized change that would not propagate out into
Remit or other code.
I'll futz around with the Hpricot based code for a while longer, but
if I can't make headway soon, I'll see what it would take to use
REXML.
Micah