Pretty print an XML?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Pretty print an XML?

Frank Muller
Hi guys

Is there a way to pretty print a valid XML string loaded from file?

/Frank

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Pretty print an XML?

Dmitry Klionsky-2

$ cat data.xml | xmllint --format -


On 09/25/2018 03:08 PM, Frank Muller wrote:
Hi guys

Is there a way to pretty print a valid XML string loaded from file?

/Frank


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

-- 
BR,
Dmitry

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Pretty print an XML?

Vance Shipley
In reply to this post by Frank Muller
On Tue, Sep 25, 2018 at 5:39 PM Frank Muller <[hidden email]> wrote:
> Is there a way to pretty print a valid XML string loaded from file?

Unfortunately with xmerl you have to sprinkle stuff like this in
yourself:  #xmlText{value="\n "}


--
     -Vance
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Pretty print an XML?

Brujo Benavides-3
Or you can use the xml simplifier ;)

On 25 Sep 2018, at 09:46, Vance Shipley <[hidden email]> wrote:

On Tue, Sep 25, 2018 at 5:39 PM Frank Muller <[hidden email]> wrote:
Is there a way to pretty print a valid XML string loaded from file?

Unfortunately with xmerl you have to sprinkle stuff like this in
yourself:  #xmlText{value="\n "}


--
    -Vance
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Pretty print an XML?

Willem de Jong-2
It may not work for all XML documents (it was not really intended as a general XML pretty printer), but you can try erlsom_lib:prettyPrint(String). It is part of erlsom (https://github.com/willemdj/erlsom).

regards,
Willem

Op di 25 sep. 2018 om 14:48 schreef Brujo Benavides <[hidden email]>:
Or you can use the xml simplifier ;)

On 25 Sep 2018, at 09:46, Vance Shipley <[hidden email]> wrote:

On Tue, Sep 25, 2018 at 5:39 PM Frank Muller <[hidden email]> wrote:
Is there a way to pretty print a valid XML string loaded from file?

Unfortunately with xmerl you have to sprinkle stuff like this in
yourself:  #xmlText{value="\n "}


--
    -Vance
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions