none
How to create xml with name space using c# RRS feed

  • Question

  • Hi,

    I need to create a serialized xml element using c# like

    <a:SomeNode>

        <Node1>Some value</Node1>

        <Node2>Some value</Node2>

    </a:SomeNode>

    This is an argument for java service for which dot net web application is client.

    Thnx in advance 

    Tuesday, October 27, 2015 9:10 AM

Answers

  • Hi Sidharth_Gupta,

    >>How to create xml with name space using c#                                 

    Based on your title, I assume the question is how to create xml with name space using c# . You can create an XML namespace using XNamespace Class.

    Please also refer to https://msdn.microsoft.com/en-us/library/bb387075.aspx for more details

    XNamespace aw = "http://www.adventure-works.com"; XElement root = new XElement(aw + "Root", "Content"); Console.WriteLine(root);

    This example produces the following output:

    <Root xmlns="http://www.adventure-works.com">Content</Root>


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Wednesday, October 28, 2015 5:42 AM