c# - Set namespace to XElement -


I get an empty xmlns = "" attribute in the xmlemat in an XML tree. When I set my namespace to the document namespace, this way:

  string xmlns = "freeform / schema description"; XNamespace ana = xmlns; Excellence interactive root tag = new excelement (ana + "interactive root tag");  

blank xmlns = "" does not exist any more, but all children of this XElement are empty xmlns = "" .

Any thoughts?

You must add child element like this:

  string xmlns = "Freeform / Schema Description"; XNamespace ana = xmlns; Excellence interactive root tag = new excelement (ana + "interactive root tag"); Interactive RouteTAG.ed (new excelment (ana + "hair element", new XAttribute ("attribute", "attribute value"));  

To get an XML like this

  & lt; Interactive Root Tag xmlns = "Freeform / Schema Discription" & gt; & Lt; ChildElement attribute = "attribute value" /> & Lt; / InteractiveRootTag & gt;  

Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -