Line wrapping
- From: Mark <i@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 18 Jan 2012 13:20:14 +0000
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.
.
- Follow-Ups:
- Re: Line wrapping
- From: Jeff Higgins
- Re: Line wrapping
- Prev by Date: Re: Volatile happens before question
- Next by Date: Re: Volatile happens before question
- Previous by thread: what is the bettter/performant way to compare org.w3c.dom.DocumentFragment
- Next by thread: Re: Line wrapping
- Index(es):
Relevant Pages
|