markww has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I made a small script which generates some tag-like output (wouldn't call it xml) and it looks like this, all on one ugly line:After the output is written to a file, I wanted to open it again and format it so it's more readable (ie. 'beautify' it):<circle>wonderful<apple color="red">very good</apple></circle>
I tried using the simple XML parser, but it reorders my tags in alphabetical order, and it also replaces my "id" attributes with "name"! I just need some basic indentation support.<circle> wonderful <apple color="red"> very good </apple> </circle>
I found on CPAN: http://search.cpan.org/~bjoern/SGML-Parser-OpenSP-0.994/lib/SGML/Parser/OpenSP.pm which I *think* will parse my sgml stuff and maybe dump it nicely in the indented format I want, but I cannot get it to build on my poor mac.
Anyone know of an easier way, or if that library above is the one to go with?
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Beautifying some SGML?
by JavaFan (Canon) on Dec 04, 2008 at 13:13 UTC | |
|
Re: Beautifying some SGML? (XML)
by toolic (Bishop) on Dec 04, 2008 at 14:05 UTC | |
by mirod (Canon) on Dec 04, 2008 at 15:04 UTC | |
|
Re: Beautifying some SGML?
by mirod (Canon) on Dec 04, 2008 at 14:52 UTC | |
|
Re: Beautifying some SGML?
by JadeNB (Chaplain) on Dec 05, 2008 at 03:46 UTC |