I'm working on Rhino (Mirth), and I've got to process / parse an XML with the following structure:
<root>
<row>
<foo-1 />
<foo-2 />
<foo-3 />
<foo-4 />
...
<bar-1 />
<bar-2 />
<bar-3 />
<bar-4 />
...
<something-else-1 />
<something-else-2 />
</row>
</root>
I want to get all the "foo" nodes only, avoiding the use of loops if possible. I've been trying somenthing like:
xml.row.(new RegExp("foo[1-4]").test()))
and a few variations of the same line, but it does not seem to work. Is there any E4X syntax / method to get this done?? I've been googling for a while, and i've read the ECMAS documentation, but i can't get this done.
Thanks in advance!
function::
namespace it's not allowed, because the script validator throws a syntax error when I use it. Also, as you said, I get reference errors when I try to usename()
orlocalName()
in the filter, so I guess it's a scope problem. It's a shame, because I really really liked this solution and it was exactly what I was looking for :( – Oct 20 '09 at 07:23