[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: transforming to breaks

Subject: RE: transforming to breaks
From: Jarno.Elovirta@xxxxxxxxx
Date: Tue, 25 Mar 2003 17:34:04 +0200
change linefeed to br
> I have a node like <nodeName>blah blah&#13;&#10;more blah 
> blah</nodeName>.
> I wish to transform this to html, using <BR></BR> for the carriage
> return/linefeed combo.
> 
> How can I do this?

Recursive template, e.g.

template "changer"
  param "text"
  choose
    when contains($text, "&#xA;")
      value-of substring-before($text, "&#xA;")
      <BR></BR>
      call-template "changer>
        with-param "text" substring-after($text, "&#xA;")
    otherwise
      value-of $text

The XML parser changes &#13;&#10; sequences into single &#10;, so you just need to change LINE FEED characters.

Cheers,

Jarno - Linnunradan käsikirja liftareille: Osa 14

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.