I’ve been using the css function from nokogiri to navigate xml and grab elements, instead of using xpath. I love the fact that it’s an option, since css feels to much more natural. But, today I ran into something I haven’t had to deal with before. I was parsing some xml from a service when I noticed the xml had some namespaced items, like so.
So, I tried this, thinking I could get the value back.
But, no luck. However, as it turns out, there is a special selector made just for this. Here is the reference on w3.org. The correct code is below: