c# - ImportNode creates empty xmlns attribute -


regrading code:

   var tmpnewnode = xdoc.importnode(newnode, true);      if (oldnode.parentnode != null)     {         oldnode.parentnode.replacechild(tmpnewnode, oldnode);         return true;     } 

tmpnewnode created empty xmlns attribute (xmlns=""). suggestion how can avoid it?

10x

what's happening here newnode comes document no namespace declared, oldnode in document namespace. in situation, node takes blank namespace on new document , shows explicitly. honest, if it's problem string comparison, won't hurt remove instances of xmlns="" xml string before work it.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -