Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #11458

Line wrapping

From Mark <i@dontgetlotsofspamanymore.invalid>
Newsgroups comp.lang.java.programmer
Subject Line wrapping
Date 2012-01-18 13:20 +0000
Message-ID <kjhdh7lginolc5q0huf9oi9ippqost583f@4ax.com> (permalink)

Show all headers | View raw


I need to write some code to wrap lines for printing.  The data to
print is XML.  I have not found that the classes that I have found
allow you to choose which characters are used as line breaks.
For example org.apache.xml.serialize.OutputFormat does not do this.

What class is good for this?

Right now I use the following code:

        OutputFormat format = new OutputFormat(input);
        format.setIndenting(true);
        format.setIndent(2);
        format.setLineWidth(lineLen);
        format.setLineSeparator(lineSep);
        Writer out = new StringWriter();
        XMLSerializer serializer = new XMLSerializer(out, format);
        serializer.serialize(input);
-- 
(\__/)  M.
(='.'=) Due to the amount of spam posted via googlegroups and
(")_(") their inaction to the problem. I am blocking some articles
posted from there.  If you wish your postings to be seen by
everyone you will need use a different method of posting.

Back to comp.lang.java.programmer | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Line wrapping Mark <i@dontgetlotsofspamanymore.invalid> - 2012-01-18 13:20 +0000
  Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-18 09:51 -0500
    Re: Line wrapping Mark <i@dontgetlotsofspamanymore.invalid> - 2012-01-18 16:04 +0000
      Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-18 13:38 -0500
        Re: Line wrapping Mark <i@dontgetlotsofspamanymore.invalid> - 2012-01-19 09:00 +0000
          Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-19 06:26 -0500
            Re: Line wrapping Mark <i@dontgetlotsofspamanymore.invalid> - 2012-01-19 14:52 +0000
              Re: Line wrapping Mark <i@dontgetlotsofspamanymore.invalid> - 2012-01-20 10:47 +0000
                Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-20 11:28 -0500
                Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-20 13:33 -0500
                Re: Line wrapping Lew <noone@lewscanon.com> - 2012-01-20 11:18 -0800
                Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-20 15:45 -0500
                Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-20 15:59 -0500
                Re: Line wrapping Mark <i@dontgetlotsofspamanymore.invalid> - 2012-01-23 09:03 +0000
                Re: Line wrapping Lew <noone@lewscanon.com> - 2012-01-23 10:15 -0800
                Re: Line wrapping Lew <noone@lewscanon.com> - 2012-01-20 11:18 -0800
                Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-21 02:10 -0500
                Re: Line wrapping Lew <noone@lewscanon.com> - 2012-01-21 12:28 -0800
                Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-20 17:17 -0500
                Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-20 17:19 -0500
  Re: Line wrapping Mark <i@dontgetlotsofspamanymore.invalid> - 2012-01-18 15:47 +0000

csiph-web