xsl-list
[Top] [All Lists]

RE: Re: outputing tags

2003-01-06 08:53:14
Hi Sam.

You also could use a specific node to wrap your quotes, something like:
<quote>
 <br>Some text that goes on first line</br>
 <br>Some text that goes on the second line</br>
</quote>

That way you can call whatever template you want to transform that in
the line feed you need (&_#10; or <br />).

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
Sam Carleton
Sent: domingo, 5 de Janeiro de 2003 17:19
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: Re: [xsl] outputing tags


On Sun, Jan 05, 2003 at 11:34:09AM -0500, cknell(_at_)onebox(_dot_)com
wrote:
It wasn't clear if you have all the answers you need, but in case you 
still need a solution to:

"Ok, then how do I do this:  I have my xml file with all the info I 
need in it.  There is one element named <quote> which contains quotes.

Some quotes need to have line break ( <br>'s in HTML).  How do I 
denote a line break in the XML and then how do I transform it?"

the answer is that XML doesn't have a special element to denote a line

break. XSLT will happily copy any new lines you put in your source 
document or ones that you introduce in the templates, but that can be 
confusing (people often get line breaks where they weren't expecting 
them because of this; see references to  <xsl:strip-space>,
<xsl:preserve-space> and the normalize-space() function).

Since an element like "<br />" has no "meaning" in XML, and because it

is a perfectly well-formed element, you can put them directly into 
your source document and they will be copied into the result tree (and

eventually serialized to your browser where "<br />" actually does 
have a meaning). Or you could introduce it in the XSLT at the 
appropriate points.

Charles,

I guess I phrased my Q the wrong way.  I am aware of the fact that the
tags in XML have no specia meaning.  But like any other programming
language there seems to be right and wrong ways of doing things.  

I am curious to know how others handle a situation I discribed above.  I
believe that I am going to run into this problem in many places and
would like to know the best solution.  Or at least the auther of the
replies best solution.

I do NOT feel that relying on the tradition linebreak is a
good idea.  I figured the best thing to do is denote a line break in my
XML the same way HTML denotes a line break. Espically considering the
target output is HTML.

Sam

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>