DOM output xml format.

Discussion in 'XML' started by Bell, Jan 26, 2005.

  1. Bell

    Bell Guest

    Does anybody know how to make DOM to output (transform) XML file in decent
    format. Now it put everything in one line. :(


    Rgds,

    Jun
     
    Bell, Jan 26, 2005
    #1
    1. Advertising

  2. "Bell" <> wrote in message
    news:NADJd.3127$...
    > Does anybody know how to make DOM to output (transform) XML file in decent
    > format. Now it put everything in one line. :(
    >
    >

    <xsl:eek:utput indent="yes" ...

    or, in Java,

    Transformer transformer ...

    transformer.setOutputProperty("indent","yes");

    Regards,
    Daniel Parker
    http://servingxml.sourceforge.net/
     
    Daniel Parker, Jan 26, 2005
    #2
    1. Advertising

  3. Bell

    Bell Guest

    Thank Daniel. But this property only wraps each element in new line. It
    does not provide a decent format for multiple level elements like :
    <root>
    < branch >
    <leaf/>
    </branch>
    </root>

    Any easy way to achieve this?

    Rgds,

    Jun

    "Daniel Parker" <danielaparker@spam?nothanks.windupbird.com> wrote in
    message news:4NDJd.3134$...
    >
    > "Bell" <> wrote in message
    > news:NADJd.3127$...
    > > Does anybody know how to make DOM to output (transform) XML file in

    decent
    > > format. Now it put everything in one line. :(
    > >
    > >

    > <xsl:eek:utput indent="yes" ...
    >
    > or, in Java,
    >
    > Transformer transformer ...
    >
    > transformer.setOutputProperty("indent","yes");
    >
    > Regards,
    > Daniel Parker
    > http://servingxml.sourceforge.net/
    >
    >
    >
     
    Bell, Jan 28, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark McKay
    Replies:
    0
    Views:
    467
    Mark McKay
    Dec 1, 2004
  2. Replies:
    0
    Views:
    583
  3. Replies:
    3
    Views:
    563
    Stefan Behnel
    Aug 3, 2007
  4. kj
    Replies:
    2
    Views:
    578
  5. Alan
    Replies:
    6
    Views:
    1,701
Loading...

Share This Page