REXML and namespace axis troubles

D

Daniel Nugent

Hello,

I've been trying to use the namespace:: in an XPath query to get at
the namespaces for some XML elements and I've been having some seirous
difficulty with it.

I kept getting a bunch of errors about nil not having a '<<' method
defined. So I went back and checked my query string and it turns out
to be fine as far as a I can tell. Then I tried a bunch of simple
query strings using he namespace:: axis and they all failed too.

For example: "REXML::XPath.match(xml.root, 'namespace::*')"

This errored and I'm not sure how much more simple I can make a query
using the namespace axis so I decided to go in and check the code in
REXML.

Going through the call chain, I came upon one section in
REXML::XPath_Parser.rb that caught my eye:

when :namespace
new_set =3D []
for node in nodeset
new_nodeset << node.namespace if node.node_type =3D=3D :element
or node.node_type =3D=3D :attribute
end
return new_nodeset

This section is near the end of the method internal_parse if you're curious=
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top