C# linq xml how to use two prefixes for same namespace?

Yes, you can use two prefixes for the same namespace. You'd do this by using two namespaces with the same value.

Yes, you can use two prefixes for the same namespace. You'd do this by using two namespaces with the same value. Var bar = XNamespace.

Get("bar"); var foo1 = XNamespace. Get("foo"); var foo2 = XNamespace. Get("foo"); var x = new XElement(foo1 + "begin", new XAttribute(foo2 + "Name", "somevalue"), new XElement("child", new XAttribute(foo2 + "Name", "somevalue")), new XElement(bar + "barElement")); But you cannot control XML namespace prefixes using LINQ-to-XML; and you should not need to control namespace prefixes.

This XML renders as As you can see, you have three namespaces and both xmlns and xmlns:p1 refer to your http://foo URI. But there's no way to tell LINQ-to-XML that it should use prefixes like foo1, foo2 etc. Trying to fiddle with XML namespace prefixes is unecessary hacking. Your code should not depend on concrete prefxies - they should be determined at parse time by reading the XML document itself.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions