SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    You want what? By when?? Milamber's Avatar
    Join Date
    Jan 2001
    Location
    California
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question xsl to html - line break rendering

    I'm looking into some things and have run into a problem that I can't get around. I searched here and read over the w3 specs, but found no insight (or i missed it )

    - http://www.creatimation.net/extra/rss-forum/index.xml

    On this page I am using an RSS feed, then a XSL transform, and finally a CSS file to change the look (I'll be adding JavaScriptfor the behaviour layer later on).

    The issue I am running into is that I want formatting of the <description> element to carry over. I want multiple line breaks, or <br /> tags to be made into html so that line breaks render. Right now neither of those work.

    I thought something like

    Code:
      <description>
      	<p>blah blah blah</p>
       	<p>blah blah blah</p>
       	<p>blah blah blah</p>
      </description>
    might work, but I couldn't figure out how to loop it.

    Any ideas? Can HTML be recognized and rendered like that? Can the p elements be run through and their data be transformed back to p tags again?

    Thanx!
    -Jeff Minard | jrm.cc - Battlefield 2 Stats

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    You can use <xsl:copy-of /> to copy the node directly to your output (HTML) document.

    http://www.w3schools.com/xsl/el_copy-of.asp

  3. #3
    You want what? By when?? Milamber's Avatar
    Join Date
    Jan 2001
    Location
    California
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks! Works like a charm!
    -Jeff Minard | jrm.cc - Battlefield 2 Stats


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •