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.

This entry was posted in To Be Categorized. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

3 Comments

  1. Posted May 29, 2008 at 9:17 PM | Permalink

    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. Posted May 30, 2008 at 7:38 AM | Permalink

    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?

  3. Posted September 4, 2009 at 1:40 PM | Permalink

    If you haven’t checked out the “Simplificator” link above, do so. Turns out support is drastically overstated.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">