nokogiri xml namespaces

J

Jonathan Rochkind

So when using nokogiri xml_element.xpath(path), you can pass a second
argument hash of alias to namespace URI, to use namespaces.

This works fine. But it's inconvenient to be passing the hash on every
call, when it's pretty much always the same hash, for several calls.

It seemed to me there ought to be a way to set the default namespace
alias mapping on the xml element itself, so it'll just stick for calls
on that element, and won't need to be explicitly passed in on every
xpath call.

nokogiri has generally such a convenient api that I figured this must be
there... but I haven't been able to find it.

Anyone know if it is?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,078
Latest member
MakersCBDBlood

Latest Threads

Top