none
How Can I store XML multiple elements in a variable? RRS feed

  • Question

  • How Can I store XML multiple elements in a variable, which I can show on windows form like have Element Level4 and it contains a module module contains name code  and than the module contains assement name etc..


    • Edited by kareem28 Thursday, December 6, 2018 7:39 PM
    Thursday, December 6, 2018 7:37 PM

All replies

  • https://social.msdn.microsoft.com/Forums/en-US/home?forum=xmlandnetfx

    You can try posting to the forum for help.


    Thursday, December 6, 2018 9:22 PM
  • Hi kareem28,

    Thank you for posting here.

    For your question, do you mean you want to create xml with multiple elements in a variable? 

    If yes, please try the code below.

    //create xml
                var xmlNode = new XElement("xml", new XElement("PanelCreate", new XAttribute("tokens", "4"), new XAttribute("material", "TV"), new XAttribute("pid_size", "1"), new XAttribute("pid", "?")),
                                                  new XElement("PanelDetails", new XAttribute("id", "11"), new XAttribute("mid_1", "11"), new XAttribute("tokens", "3")));
                xmlNode.Save("test.xml");

    >>how on windows form like have Element Level4 and it contains a module module contains name code  and than the module contains assement name etc..

    What do you mean about this?

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Stanly Fan Wednesday, December 12, 2018 8:50 AM
    Friday, December 7, 2018 6:27 AM
    Moderator