How to read and save and XML with Proper formatting (Parsing)

Discussion in 'C#' started by Sanju_1982, Aug 22, 2008.

  1. Sanju_1982

    Sanju_1982 New Member

    Aug 22, 2008
    Likes Received:
    Trophy Points:

    Suppose I want to read and write an XML file.

    I want to create an application project ( in C# 2008) in such a way so that when i browse and open any XML file in my project, it will open in a proper formatting with indentation (similiar to what we have in other editors like XML Editor in VS, XML Spy etc).

    It will have a collapse Expand feature which can support Syntax based colours. And further it will able to edit the XML and save it back.

    The XML structure needs to be created at runtime when I'm reading the XML file using Regular expression.

    Further the validation and parsing check of the XML structure can be properly done.

    Similarly, I will able to directly edit and modify the XML structure at run time and save it back.

    (I know that if I open an XML file in an IE browser, I will get the proper XML structure, but the only problem is that I wont to able to edit the XML on the IE browser and save it back)

    I hope I am able to clarify my problem.

    Please help if you have some codebase on the same. If you can help me with some source code it will be really appreciable.
    Further whether will it be a good idea to load the XML file in a RichTextBox control and then do the parsing and formatting of XML.


Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice