xsl-list
[Top] [All Lists]

RE: outputing tags

2003-01-06 09:30:47
[ Sam Carleton]

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?


It is all a matter of what you start with and what you want to end up
with.  The stylesheet transforms the one into the other.

So what do you want to end up with?  You say you want a "line break" in
the XML, but XML inherently knows nothing about line breaks.  Perhaps
you mean that you want to create html output that happens to be
well-formed xml as well?  Then a <br/> element would just stay as is, if
there is one in the source.   Otherwise, no one can answer you without
knowing how to determine where line breaks should occur.

In general, if you just want to echo some existing element content
(complete with <br/> or other elements), you would use xsl:copy-of.  If
you want to echo an element but change some of its child elements, use
an identity transform where you specify templates only for the elements
you want to change.  The FAQs and archives contain examples.

Cheers,

Tom P

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



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