Re: [go-nuts] Re: XML Beautifier that doesn't rewrite the document

2016-11-07 Thread Tong Sun
On Sun, Nov 6, 2016 at 5:35 PM, Tong Sun wrote: > > On Saturday, November 5, 2016 at 3:51:55 PM UTC-4, Tong Sun wrote: >> >> >> On Saturday, November 5, 2016 at 3:42:27 PM UTC-4, Tong Sun wrote: >>> >>> >>> On Sat, Nov 5, 2016 at 12:26 PM, Sam Whited wrote: >>> On Fri, Nov 4, 2016 at 4:32

Re: [go-nuts] Re: XML Beautifier that doesn't rewrite the document

2016-11-06 Thread Florian Weimer
* Tong Sun: > The dark voodoo regexp as described here works for many cases. > http://www.perlmonks.org/?node_id=261292 In general, whitespace is significant in XML, so you need a DTD or schema to make sure that you can make such edits without changing the meaning of the document. -- You

Re: [go-nuts] Re: XML Beautifier that doesn't rewrite the document

2016-11-06 Thread Tong Sun
On Sun, Nov 6, 2016 at 5:08 AM, Simon Ritchie wrote: I have a much simpler approach which works for me. Open the document with > a web browser and it displays it nicely formatted. Yeah, I believe it is doable. If Chrome and/or Firefox can do it, beautifying XML without rewrite the document,

Re: [go-nuts] Re: XML Beautifier that doesn't rewrite the document

2016-11-05 Thread Sam Whited
On Sat, Nov 5, 2016 at 2:51 PM, Tong Sun wrote: > The dark voodoo regexp as described here works for many cases. > http://www.perlmonks.org/?node_id=261292 > > But I did found its own limits when trying more samples... Regular expression are, well, regular. This means that