Categories > OpenTBS with DOCX >

Word showing xml tags

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: João Gil
Date: 2014-01-29
Time: 16:47

Word showing xml tags

i got an issue using onformat method... because when i use it, to change "\n" for "<w:br/>", tbs show that tag in the word doc...
PHP:
public function f_html2docx($FieldName, &$CurrVal) {
    $CurrVal= preg_replace("/(\n|\r\n)/", "<w:br/>", $CurrVal);
}
template:
[base_sub1.body;onformat=html.f_html2docx]

so, my question is why word is showing <w:br/> tags..

thanks in advance
By: Skrol29
Date: 2014-01-29
Time: 23:32

Re: Word showing xml tags

Hi,

The "onformat" function does not replace the string conversion or parameter "frm". It happens just before.
So you can use "strconv=no" in order to prevent from converting XML to normal contents.

By the way, I'm surprised with your function because OpenTBS should replace line breaks for you.

By: Skrol29
Date: 2014-02-02
Time: 00:12

Re: Word showing xml tags

Hi João,

Thanks for having sent to me the template.

OpenTBS does correctly replace the line-breaks. There is no need to use your onformat function.
The result you have is because the paragraph is aligned with "justified" instead of "align left".

By: Gil
Date: 2014-02-02
Time: 15:25

Re: Word showing xml tags

yes, but i want it justified like i showed you... i knew "align left" would solve the problem, but it wasn't what i want...
By: Skrol29
Date: 2014-02-03
Time: 23:26

Re: Word showing xml tags

This is a Ms Word problem, not an OpenTBS problem. If you want more line-breaks, then double the line-breaks in the data before to insert them.