Jump to content
  • Advertisement
Sign in to follow this  
EvilNando

[.net] XmlReader woes

This topic is 3663 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all I'm making a program that generates an XML file (in memory) and then outputs what has been generated through a richtextbox control Ive managed to accomplish this task by doing this: byte[] byte_array = new byte[memory_stream.Length]; memory_stream.Read(byte_array, 0, (int)memory_stream.Length); parent_form.rch_txtbox.Text = Encoding.UTF8.GetString(byte_array); where memory_stream is the assigned stream for the XmlWriter object. while this does the job, I would like to know if it is possible to get the XML line by line , that way I could format with colors the tag names and their values (Pretty much like visual studio does when opening xml files) any ideas? Thank you

Share this post


Link to post
Share on other sites
Advertisement
Once you have your XML string, you can split it into lines easily enough by doing something like this:

string[] lines = xmlText.Split(Environment.NewLine);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!