Here's a chunk of XML:
It's easy enough to select all
elements, or all
elements inside a
But how do I select all
elements that are not inside
section.ignored? This doesn't work:
...because that actually means "all elements that are contained in any section that is not ignored", including the top-level section that wraps everything else!
Additional twist: unlike the simplified sample above, the real XML I have to deal with is nested to arbitrary depth, including sections within the ignored section(s).
And yes, I could just substract the bad array from the full array in Ruby and call it a day, but I'd prefer a pure CSS solution (or, if you must, XPath) if possible.