By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,925 Members | 727 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,925 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
su******@poczta.fm (fis) wrote:
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?

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #2

P: n/a
fis
"Jukka K. Korpela" <jk******@cs.tut.fi> wrote in message news:<Xn*****************************@193.229.0.31 >...
su******@poczta.fm (fis) wrote:
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.


I understand separate data and view idea but there is dificult to
separate most simple presentation instructons like: break line, bold,
.... .
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?


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
Jul 20 '05 #3

P: n/a
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
Jul 20 '05 #4

P: n/a
fis
David Carlisle <da****@nag.co.uk> wrote in message news:<yg*************@penguin.nag.co.uk>...
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
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.