Re: [go-nuts] Beautify XML

2016-11-05 Thread Tong Sun
Oh, thank you Sam for both of your points. Each is very valuable to me! Oh, and the third one too. :-) Thanks again! On Sat, Nov 5, 2016 at 12:16 PM, Sam Whited wrote: > I should also state that in this example you could of course just use > MarshalIndent, the point was to show that you could

Re: [go-nuts] Beautify XML

2016-11-05 Thread Sam Whited
On Fri, Nov 4, 2016 at 4:32 PM, Tong Sun wrote: > How to beautify a given XML string in GO? > > The xml.MarshalIndent() only apply to a GO structure, not XML strings. Sorry, third time's the charm. I think I didn't understand what you were asking. If all you need is the bulit in indentation you c

Re: [go-nuts] Beautify XML

2016-11-05 Thread Sam Whited
I should also state that in this example you could of course just use MarshalIndent, the point was to show that you could do it manually if you need more customized formatting. On Sat, Nov 5, 2016 at 11:13 AM, Sam Whited wrote: > On Sat, Nov 5, 2016 at 10:57 AM, Tong Sun wrote: >> So any plan to

Re: [go-nuts] Beautify XML

2016-11-05 Thread Sam Whited
On Sat, Nov 5, 2016 at 10:57 AM, Tong Sun wrote: > So any plan to add beautify a given XML string feature soon? Thx. No, sorry, I was just pointing out that by manipulating a token stream you could probably do it yourself fairly easily. Eg. something like this simple example (most of the error ha

Re: [go-nuts] Beautify XML

2016-11-05 Thread Tong Sun
On Sat, Nov 5, 2016 at 11:39 AM, Sam Whited wrote: > I've been playing around with an XML token stream processing API: > > https://godoc.org/mellium.im/xmlstream > > It's still experimental, and likely to change, but it would probably > be pretty easy to write a transformer that keeps track of ii

Re: [go-nuts] Beautify XML

2016-11-05 Thread Sam Whited
On Fri, Nov 4, 2016 at 4:32 PM, Tong Sun wrote: > How to beautify a given XML string in GO? > > The xml.MarshalIndent() only apply to a GO structure, not XML strings. Aside: Note that the language is called "Go", not "GO". I've been playing around with an XML token stream processing API: https:

[go-nuts] Beautify XML

2016-11-04 Thread Tong Sun
How to beautify a given XML string in GO? The xml.MarshalIndent() only apply to a GO structure, not XML strings. Thanks -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an