EDN Admin
Well-known member
Hi,
How to remove namespace from root element using linq
below is my code
var ss = new XElement(ns + "Attribute",<br/>
new XAttribute("name", "ss"),<br/>
new XElement(ns + "value", 8),<br/>
new XElement(ns + "type", "string"),new XAttribute (XNamespace.Xmlns + "atr", ns));
I am getting below output:
<atr:Attribute name="ss" xmlns:atr="http://w3s.de/Schema <br/>
<atr:value>8</atr:value><br/>
<atr:type>string</atr:type><br/>
</atr:Attribute>
But I need output like below :
<atr:Attribute name="ss <br/>
<atr:value>8</atr:value><br/>
<atr:type>string</atr:type><br/>
</atr:Attribute>
namespace has to remove from root element.
View the full article
How to remove namespace from root element using linq
below is my code
var ss = new XElement(ns + "Attribute",<br/>
new XAttribute("name", "ss"),<br/>
new XElement(ns + "value", 8),<br/>
new XElement(ns + "type", "string"),new XAttribute (XNamespace.Xmlns + "atr", ns));
I am getting below output:
<atr:Attribute name="ss" xmlns:atr="http://w3s.de/Schema <br/>
<atr:value>8</atr:value><br/>
<atr:type>string</atr:type><br/>
</atr:Attribute>
But I need output like below :
<atr:Attribute name="ss <br/>
<atr:value>8</atr:value><br/>
<atr:type>string</atr:type><br/>
</atr:Attribute>
namespace has to remove from root element.
View the full article