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


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

Re: Line wrapping

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail
From Jeff Higgins <jeff@invalid.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Line wrapping
Date Wed, 18 Jan 2012 09:51:12 -0500
Organization A noiseless patient Spider
Lines 23
Message-ID <jf6lq0$9hg$1@dont-email.me> (permalink)
References <kjhdh7lginolc5q0huf9oi9ippqost583f@4ax.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Wed, 18 Jan 2012 14:43:12 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="qwFw1g9RsQ6TkML5yezG9A"; logging-data="9776"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1810GHtxLv204zu8UFW/EdRcFIOFCAVYiw="
User-Agent Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20111110 Icedove/3.0.11
In-Reply-To <kjhdh7lginolc5q0huf9oi9ippqost583f@4ax.com>
Cancel-Lock sha1:oJbHodz3/pcav6PSQY2KFz8ixGk=
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:11462

Show key headers only | View raw


On 01/18/2012 08:20 AM, Mark wrote:
> 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.

This may be of interest.
<http://xerces.apache.org/xerces2-j/faq-general.html#faq-6>

>
> 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);

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next 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