A test file is provided (eae07731), and the symptom is that it reads to many atoms if there are elements with a local name "atom" in foreign namespace (as in this test file). For this, I had to track previous modules, in order the elements properly (CMLModuleStack; 1fb57bca, 40fff56c), so that I can then properly ignore other namespaces (82f0fa1d; keep in mind that within other namespaces, CML may occur again...). It also uncovered two other (small) bugs, which I fixed (5662168f, ff6f3336).
Patches available at:
https://github.com/egonw/cdk/compare/512-m-multiNamespaceCML
Solution/code looks good. I still have the unit test failing in error from command line but is okay in IDE. I think is probably silly XML libs but I'm going to push and see what Jenkins makes of it.
Other than that, a couple of minor comments:
applied and pushed