And how do I add this element ?
I tried :
List<Step> steps = new ArrayList<Step>();
Iterator<Step> iter = recette.getSteps().iterator();
while(iter.hasNext()) {
Step myStep = iter.next();
myStep.setContent(myStep.getContent().replaceAll("\n", "<text:line-
break>"));
steps.add(myStep);
}
template.setField("steps", steps);
And in my ODT, I have "<text:line-break>" and not a new line :(
Thanks !
On 28 déc, 18:22, J David Eisenberg <[email protected]>
wrote:
> On Mon, Dec 28, 2009 at 8:03 AM, JMD <[email protected]> wrote:
> > Hi !
>
> > Thanks for helping me !
> > I'm french, and that would explain the number of english errors in
> > this little text :D
>
> > I'm trying to edit a template like the "test.odt".
>
> > I'm building a ArrayList to make a OOo list. It's working, but the
> > char "newline" (\n\r or \r\n I never know...) don't create a newline
> > in the output ODT.
> > I check the "content.xml" file in the output file, and the newline
> > char isn't replaced by a tag for end+begin of the line...
>
> > Quote content.xml :
> > <text:list-item><text:p text:style-name="P1"><text:span
> > text:description="item.getContent()">Line1
> > Line2
> > Line3</text:span></text:p></text:list-item>
>
> > How can I make a new line ?
>
> XML "normalizes" whitespace, so putting in a \r or \n won't help. You
> need to add a <text:line-break> element.
>
> Seehttp://books.evc-cit.info/odbook/ch03.html#whitespace-section
>
> > Thanks for all !
>
> > JMD