Cocoon and break line (<br/>) problem.

F

fis

Hi all,

I've problem because there are needed break lines in my texts on the
web site but i can't do it :(

My pipeline looks like: XMS -> I18N -> XSLT -> HTML

I have lot of texts in my "languages" files and these are describes
for things on my website.
Example text looks like this:

....
This is very good machine and it can help to resolve problems: (hiere
<br/>)
1. blah blah blah,(hiere <br/>)
2. blah1 ...(hiere <br/>)
3. more blah(hiere <br/>)
(hiere <br/>)
Rest of descriping text.
....

How can i tell cocoon where i want to do break lines?
I have tried for 2 days and have no solution. I don't like to cat text
and separate it into xml tags for each new line (it's impossible to
maintain in language translated files).

I must add that inserted "<br/>" into languages files or even XML
files is converted by another cocoon transformation to "&lt;br/&gt;".

Thank you and regards,
Sławek
 
J

Jukka K. Korpela

I've problem because there are needed break lines in my texts on the
web site but i can't do it :(

The problem description is somewhat vague. Normally, line breaks should
be an issue in presentation (rendering), not markup. What you need in
markup is something to "hook" presentation suggestions to - basically,
elements that you'll want to be followed or preceded by a line break.
This is very good machine and it can help to resolve problems: (hiere
<br/>)
1. blah blah blah,(hiere <br/>)
2. blah1 ...(hiere <br/>)
3. more blah(hiere <br/>)
(hiere <br/>)

If you are generating ultimately HTML, as you describe, why don't you
simply generate what's most natural markup there? That would mean <ol>
here (and the preceding text would be <div> or <p>, and the "empty line"
(?) after the list should be handled by setting margin-bottom in CSS).
The <ol> element is by default rendered so that each item (<li> element)
is followed by a line break. So where's the problem?
 
F

fis

Jukka K. Korpela said:
The problem description is somewhat vague. Normally, line breaks should
be an issue in presentation (rendering), not markup. What you need in
markup is something to "hook" presentation suggestions to - basically,
elements that you'll want to be followed or preceded by a line break.

I understand separate data and view idea but there is dificult to
separate most simple presentation instructons like: break line, bold,
.... .
If you are generating ultimately HTML, as you describe, why don't you
simply generate what's most natural markup there? That would mean <ol>
here (and the preceding text would be <div> or <p>, and the "empty line"
(?) after the list should be handled by setting margin-bottom in CSS).
The <ol> element is by default rendered so that each item (<li> element)
is followed by a line break. So where's the problem?

My problem is where i insert <br>, <ol> or another <something> tag
into XML source file, it's converting as <br> -> &lt;br&gt; and
presented like simple text insted of html tag.
How can I insert special "hooks" and how and where can I translate it
to target html tag? for example: \n (hook) converted to <br> (target).

If i don't understand your answer, show me simple example please.

Regards,
Sławek
 
D

David Carlisle

My problem is where i insert <br>, <ol> or another <something> tag
into XML source file, it's converting as <br> -> &lt;br&gt; and

XSLT/cocoon doesn't do that by default, so it must be something in your
source file (eg the <br/> is inside a CDATA section) or something in
your stylesheet) that is producing the result that you state.
You'll need to say more about what your source or stylesheet looks like.

David
 
F

fis

David Carlisle said:
My problem is where i insert <br>, <ol> or another <something> tag
into XML source file, it's converting as <br> -> &lt;br&gt; and

XSLT/cocoon doesn't do that by default, so it must be something in your
source file (eg the <br/> is inside a CDATA section) or something in
your stylesheet) that is producing the result that you state.
You'll need to say more about what your source or stylesheet looks like.

David

My cocoon pipeline look like :
(generator)XML -> (transformer)I18N -> (transformer)XSLT ->
(serializer)HTML

XML file: xml/a.xml
Dictionary files: translations/d.xml, d_pl.xml, d_en.xml
XSLT file: xslt/a.xslt

Content of a.xml is:
....
<part-content>
<i18n:text i18n:key="text_1" i18n:catalogue="d">first part of text
and second part of text.
</i18n:text>
</part-content>
....

Content of d.xml file is:
....
<message key="text_1">first part of text <<hiere i want to have a
break line>> and second part of text.</message>
....


Content of a.xslt file is:
....
<xsl:value-of select="./part-content"/>
....


If i put <br> in place: <message key="text_1">first part of text <br>
and second part of text.</message>, the result after next
transformation (by i18n) is: "first part of text &lt;br&gt; and second
part of text."

How to resolve this problem?

Slawek
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top