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
Post a Comment