[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Pretty-printers for XML and JSON
- From: "Yang Fan" <missdeer@...>
- Date: Sun, 29 Aug 2010 14:53:07 +0800
Hi, Alexander Gladysh
RapidXML saves XML document in pretty format, but it makes each node a line. There is a simple encapsulated Lua module which can be found from http://code.google.com/p/lua-binding-libraries/ , you can build it by bjam or just download a pre-built package contained in LuaPack for 32-bit Windows platform from http://code.google.com/p/luapack/ .
======= 2010-08-29 14:37:36 you wrote:=======
>Hi, list!
>
>For my in-house documentation generator tool I need to be able to
>pretty-print XML and JSON data (both of which I receive as a string
>with a single line, no line breaks or extra spaces).
>
>It is important that each parameter in the resulting string will be on
>a separate line. This is a surprisingly rare feature for command-line
>XML pretty-printers I've tried (note that, anyway, I need a Lua
>module, not a command-line tool).
>
>Input:
>
> <foo bar="bar1" baz="baz1" />
> { foo: { bar: "bar1", baz: "baz1" } }
>
>Output:
>
> <foo
> bar="bar1"
> baz="baz1"
> />
>
> { foo: {
> bar: "bar1"
> baz: "baz1"
> } }
>
>Another requirement is that the both modules should be installable
>with LuaRocks — but I may write rockspecks myself.
>
>Do you know a module that will do what I want?
>
>Alexander.
>
= = = = = = = = = = = = = = = = = = = =
Regards
Yang Fan
missdeer@gmail.com
2010-08-29