Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3324248
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:23:56+00:00 2026-05-17T23:23:56+00:00

I am using Umbraco and I need to display an image in a Rss

  • 0

I am using Umbraco and I need to display an image in a Rss Feed. The feed is generated by Xslt.

Everything works if I do text stuff. Such stuff is technically feasible, but the feed I analyzed had been generated by WordPress.

The challenge is that I have no idea how I can embed within my tag.

I have a variable, say “url”, that returns the full url of the underlying image. How can I insert within ? Remember I am using Xslt to achieve the task.

<content:encoded>          
  <img src="{$url}" />
</content:encoded>

I guess that CDATA must be used, but I am not able to escape correctly illegal characters 🙁

Thanks for your help.

Roland

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:23:56+00:00Added an answer on May 17, 2026 at 11:23 pm

    roland, you’re trying to escape things twice. It’s unnecessary (not to mention hideous!) This page shows:

    <content:encoded><![CDATA[This is <i>italics</i>.]]></content:encoded>
    

    I.e. they’re just escaping the markup inside the <content:encoded> once, and they use CDATA to do that. In your case, CDATA is awkward because you need to substitute $url in the middle. So you could use two CDATA sections wrapped around an <xsl:value-of select="$url" />: (indented for clarity)

    <content:encoded>
      <![CDATA[<img src="]]>
      <xsl:value-of select='$url' />
      <![CDATA[">]]>
    </content:encoded>
    

    But that would be needlessly verbose. The second CDATA section is unneeded. And we can do better while using the same principle: escape the markup characters (once) that would cause the string to be parsed into a tree. In your case, only the initial < needs to be escaped. You can use &lt; instead of CDATA to escape the <. Put this in your XSLT:

    <content:encoded>&lt;img src="<xsl:value-of select='$url' />"></content:encoded>
    

    The <xsl:value-of> is not really inside quotes, from XSLT’s perspective… those quotes are just the content of text nodes. The <xsl:value-of> works as a normal XSLT instruction.

    Change select='$url' to select="concat($siteUrl, photo)" if that’s what you need. (I.e. photo is a child element of the context node, and its text value is the name of the image file.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to read in an XML feed using an XSLT Macro in Umbraco
Using Umbraco, which is quicker to load on a page... XSLT Macro or a
I've created a menu in umbraco using XSLT. The menu is using the usual
We are using Umbraco 4.5 in our Application. We need to deploy same application
I need to develop asp.net web application using umbraco cms and iam a beginner
I’m using Umbraco 4.7.0 My goal is to get the image path from a
I'm creating some xslt's using Umbraco 4.5.2 and I want to add de set:distinct
I'm using Umbraco and every page is a master page which is a sub
I'm using Umbraco 5. Is it possible to create new Document Type programmatically using
I am running a site using Umbraco 4. In Safari (Mac) when I refresh

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.