• Answers
  • Web

Formatting a C# string to a proper XML format

I am looking for a way to take a C# string and format it so that it is in proper XML format.

EX: 

"<quiz><question><text>This is the question</text></question></quiz> 

 The string is in a single line and I want to format it im a proper XML layout.


Share Send to a friend Watch Report
 
 

Posted Answers

 
17 helpful answers

I'm not too familiar with C#, but there's an article (with code)

on The Code Project that looks like it does what you want.  If you're looking for more advanced formatting (coloured HTML output etc.) then squishySyntaxHighlighter might be useful.

Sign in to participate

Got an answer for Questions? Would you like to comment on the posted answers, or vote for the one which you think is the best?

Sign up for a free account, or sign in (if you're already a member).

Explore Related Questions

Other people asked questions on similar topics, check out the answers they received:


Q:

String to xml format string in C#

How do I convert a string to valid xml string? I'd like to convert all the characters so my xml will be valid. I need a C ...
Submitted by dudushmaya   3 years ago.
  • viewed 70766 times
Last answer posted 10 months ago by arvind


Q:

What is c#

what is c#
Submitted by pradeepbaloni   2 years ago.
  • viewed 571 times
Last answer posted 2 years ago by Eran


Q:

Html and xml

I have 2 files: XML file and XSL file. When double clicking the XML file, the page is presented in the browser with associated XSL ...
Submitted by amitre   5 months ago.
  • viewed 55 times



» More...

Explore Related Posts in Forums

C-C-C-C-Combo

C-C-C-C-Combo C-C-C-C-C-ComboC-C-C-C-C-C-C-Combo! This post... -C-C-C-C-Combo I STILL BELIEVE IN BLUEQuote: C-C-C-C-C-...

C-c-c-c-cold

... It all counts in your favor... NixieHi Gypsy, I would GLADLY trade the hot flashes for feeling c -c-c-cold... I am well past menopause, but I still get these horrid hot flashes... (and heat I do notice that after I lost 80 pounds, I now feel colder during the fall and winter months. I also think it has something...

6/11 - C C Penny pitch. C C Sox win. C C Sabathia die like a dog.

The Sox lead the Yankees 7-0 on the season for the first time since 1912, when: the Titanic sank; Fenway Park opened; France... legalized sodomy ; and some German synthesized MDMA (aka ecstasy). So let's sodomize these Titanic-salaried bastards... Lead pipe these sumbitches. This post has been edited by JohnnyTheBone : Jun 11 2009, 09:14 AMCan we title this: Battle of...
» More...
Powered by
Feed - Subscribe to changes to this Q&A Blog
ADVERTISEMENT
  • Answers
  • Web
Copyright © 2006-2009, Yedda Inc. and respective copyright owners · CC License