Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Lee 3 posts 23 karma points
    Nov 03, 2012 @ 21:23
    Lee
    0

    RSS XSLT Template Problems

    Hi all,

    I look after a site that advetisers jobs, the jobs have been created by using the same method of adding a news item as there are never going to be that many jobs. So in the content tab I have a jobs directory and under that are all the jobs.

    The company now want the job information displayed in an rss feed, I have created the rss xslt file and can get the content pullled through but as there are quite a few values like job title, salary, employer, details I want to display these in the rss feed.

    I have updated this:

    <content:encoded>
        <xsl:value-of select="concat('&lt;![CDATA[ ', ./jobTitle,']]&gt;')" disable-output-escaping="yes"/>
    </content:encoded>

    and say I want to add another value like job details how do I add this as if I just create a new xsl: value like below:

    <content:encoded>

    <xsl:value-of select="concat('&lt;![CDATA[ ', ./jobTitle,']]&gt;')" disable-output-escaping="yes"/>
    <xsl:value-of select="concat('&lt;![CDATA[ ', ./jobDetails,']]&gt;')" disable-output-escaping="yes"/>

    </content:encoded>

     

    The output is on one line, how to I get it to go onto it's own line.


    Thanks for any help

    Lee

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Nov 24, 2012 @ 02:53
    Lee Kelleher
    0

    Hi Lee,

    Not sure if you figured out how to resolve the issue?

    I was going to suggest that you could make use of a setting in the <xsl:output> element called "cdata-section-elements"

    <xsl:output method="xml" omit-xml-declaration="yes" cdata-section-elements="content:encoded" />

    This way the XSLT will automatically add the CDATA sections to the "content:encoded" elements, so you don't have to worry about the encoding/escaping.

    Cheers, Lee.

  • Lee 3 posts 23 karma points
    Nov 25, 2012 @ 22:03
    Lee
    0

    Hi Lee,

    Thank you for the reply, I found a solution but not a very elegant one, so your's will come in handy.

    Thanks again.

    Lee

Please Sign in or register to post replies

Write your reply to:

Draft