You can rebind *prxml-indent*. It's by nil by default, which means no
indentation and (confusingly) no line breaks. If you set it to 0, you
will get line breaks but with no indentation. With a greater value,
you will get line breaks with indentation. If you had looked at the
code, this should have been obvious at a glance.

user> (prxml [:field {:name "id"} [:foo 1]] [:field {:name "name"} [:foo "me"]])
<field name="id"><foo>1</foo></field><field name="name"><foo>me</foo></field>nil

user> (binding [*prxml-indent* 0] (prxml [:field {:name "id"} [:foo
1]] [:field {:name "name"} [:foo "me"]]))
<field name="id">
<foo>1
</foo>
</field>
<field name="name">
<foo>me</foo>
</field>

user> (binding [*prxml-indent* 2] (prxml [:field {:name "id"} [:foo
1]] [:field {:name "name"} [:foo "me"]]))
<field name="id">
  <foo>1
  </foo>
</field>
<field name="name">
  <foo>me</foo>
</field>

-Per

On Fri, Apr 16, 2010 at 11:54 AM, Wilson MacGyver <[email protected]> wrote:
> Is it possible to have customize clojure.contrib.prxml's output?
>
> the following
>
> (prxml [:field {:name "id"} 1]
>       [:field {:name "name"} "me"])
>
> produces
>
> <field name="id">1</field><field name="name">me</field>
>
> which becomes very hard to read when you have a bunch of fields. How
> do I at least
> add a newline after each of them, or maybe even indent them somehow?
>
> Thanks,
>
> --
> Omnem crede diem tibi diluxisse supremum.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to