JamesNK/Newtonsoft.Json — pull request #217 by ygalbel (2014-02-20 20:50:07+00:00)
Title: Fix namespace problem when root don't have namespace and one of children have

Hi.
Is a bug in a special case when you take a XML convert it to JSON and back to XML.
Case is when source XML don't have namespace and one of children have namespace.
What happen in current version is that all children after him will have a namespace.
In example, if you have an xml like this:

Asd
AAA
adad

after you convert it to json and back to xml, you will have an XElement like this

Asd
AAA
adad

The bug is that DefaultNamespace in manager object, is always the first namespace inserted,
so all child after first one will get a namespace.

The fix i purpose is to reset default namespace when the code Pop a scope.

I create a test that recreate the bug, so you can check it easily.

Thanks to accept the request.
Ygal