473,407 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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

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
4 7824
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
6
by: Lasse | last post by:
I have done this simple function, it seems to work as intended, to solve a problem i have had for a while. I couldnt find any sample around that was working for me. I would like to test it with...
2
by: John D | last post by:
can anyone explain why a site would use this in their page <!--<BR>--> Presumably it is hiding the <BR> from ... ??? TIA John
10
by: localpricemaps | last post by:
i have some html that looks like this <address style="color:#">34 main,<br> Boston, MA</address> and i am trying to use the replace function to get rid of the <Br> that i scrape out using...
9
by: Wayne | last post by:
$a = $_POST; # txt_content = This is a<CR><LF>Test $p = str_replace ("%0D%0A", "<br>", $a); That is the above code that I am using, however, it is not picking up the CR/LF from the textarea. I...
4
by: Christofer Dutz | last post by:
Hi, I am having a small problem, that is driving me nuts. My application reads some Xml and runs 2 Xsl Transformations to generate HTML. As soon as my second XSL introduces some <br/tags, the...
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
6
by: JoeS | last post by:
I'm new to XSLT, it what our old website developer used but he has now left our company. I have been given the task of making our site output as valid XHTML as I can get it. Currently in the .XSL...
7
by: Nathan Sokalski | last post by:
Something that I recently noticed in IE6 (I don't know whether it is true for other browsers or versions of IE) is that it renders <br/and <br></br> differently. With the <br/version, which is what...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.