May 22 2008
Hpricot Does Namespaces?
Seems like I was a bit hasty in my condemnation of Ruby XML parsing: Hpricot apparently handles namespaces okay through the magical .%() syntax. This tip is shared by Garrick Van Buren based on a Ruby.MN mailing list conversation.
I’ll let you know how well it works out for me.
Popularity: 2% [?]







I’ll believe it when I see it. My suspicious is that it doesn’t actually work, but I’m too lazy to write the code to prove it. Was planning to just throw some XML I know will break an incorrect implementation at Cullect, but ran into some other issues with his Atom handling code that prevented me from being able to run those tests. But I’m confident enough that Hpricot’s .%() syntax won’t do namespaces correctly that it’s not bothering me that I don’t have a verifiable answer yet.
What do you suspect is its failing?
There’s no concept of “registering” a namespace (a la XmlSlurper), so I think it’s actually just picking up prefix. That might be passable for me.
Is there something else you’re thinking about?