Recent

Author Topic: Write TXMLDocument to a pretty formatted string  (Read 3005 times)

JimKueneman

  • Full Member
  • ***
  • Posts: 178
Write TXMLDocument to a pretty formatted string
« on: August 15, 2012, 06:04:19 am »
I am sure this is obvious but I am missing it.  How do I write a TXMLDocument that I have created dynamically in code to a nicely formatted string that I can assign to a TSynEdit.Text?
  :-[
Thanks,
Jim

Leledumbo

  • Hero Member
  • *****
  • Posts: 8244
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Write TXMLDocument to a pretty formatted string
« Reply #1 on: August 15, 2012, 01:37:37 pm »
Does XMLWrite.WriteXMLFile work for you?

JimKueneman

  • Full Member
  • ***
  • Posts: 178
Re: Write TXMLDocument to a pretty formatted string
« Reply #2 on: August 16, 2012, 03:08:11 pm »
I was expecting something a bit more packaged (return a string directly) but yes this did work with a small bit if effort.  Thanks,
Jim

KpjComp

  • Hero Member
  • *****
  • Posts: 680
Re: Write TXMLDocument to a pretty formatted string
« Reply #3 on: August 16, 2012, 03:12:28 pm »
There is a WriteXMLFile that takes a TStream.

So you could just create a TStringStream, and then you can avoid saving to file, if that's what your after.

 

TinyPortal © 2005-2018