473,757 Members | 6,899 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7862
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.tu t.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)I1 8N -> (transformer)XS LT ->
(serializer)HTM L

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">fi rst 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">fi rst 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
10568
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 type="text/javascript"> <!]> </script> <script type="text/javascript"
6
12155
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 you and see if there are any improvments that i should make ;-) It should be fast and if possible compatible with todays modern browser-standards. It should be activated by the onload-event. This is my code, free for all to use:
2
1948
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
14029
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 this code: for oText in incident.fetchText( oRE): strTitle += oText.strip()
9
43159
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 have also attempted singular variations of the CR/LF combination and even reversed the sequence without success. Is it possible that it may be encoded differently and if so what is it? Thanks
4
4343
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 application crashes with the same error message I would get when writing <brand no closing tag. To make everything a little stranger, even <br></brseems to be bad while <lbr/is fine. Ive tried some other tag names and the problem only appears with...
3
3381
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, &gt ,&ltCompany&gt to display '<', '>' and '<Company>' respectively. But is there any freeware code available which could implement the above functionality without having to use &gt,&lt and such stuff???
6
2390
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 files I write self-closing tags like <br/> but in the output XHTML they come out as <br> and therefore the page doesn't validate. This happens for other self-closing tags like <img src=""/> too. I don't really know XSLT so I don't know how I can fix...
7
3626
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 most people use when they write static code (some people use <br>, but with xhtml you are required to close all tags), IE6 simply breaks to the next line like it is supposed to. However, with <br></br>, which is what is sometimes generated by...
0
9489
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9298
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
7286
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6562
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5172
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3829
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2698
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.