May 22 2008

Hpricot Does Namespaces?

Published by Robert Fischer at 2:25 pm under To Be Categorized

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% [?]

2 Responses to “Hpricot Does Namespaces?”

  1. Bob Amanon 29 May 2008 at 9:17 pm

    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.

  2. Robert Fischeron 30 May 2008 at 7:38 am

    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?

Trackback URI | Comments RSS

Leave a Reply

Green Web Hosting! This site hosted by DreamHost.