Set namespace to XElement



I get an empty xmlns="" attribute in XElemenet in an XML tree. When I set its namespace to the document namespace, like this:



string xmlns="FreeForm/SchemaDescription";//Tili
XNamespace ana = xmlns;//Tili
XElement interactiveRootTag = new XElement(ana + "InteractiveRootTag");//Tili


the empty xmlns="" is not exist any more, but all of the children of this XElement, get the empty xmlns="".


Any ideas?


No comments:

Post a Comment