Atom 1.0 feed inserted via feed block chooser

Allie's Avatar

Allie

03 Jun, 2010 10:49 PM

Hi there,

I have a regular page that has a feed block chooser along with some other elements, and the block chooser contains an atom 1.0 feed from our blog site. I am having trouble finding the right feed content (see below for details). Is there a sample file somewhere? I am on version 6.4.1. Thanks in advance!

The data definition looks like this:
<system-data-structure> <group identifier="Main-Content" label="Main Content"> <text wysiwyg="true" identifier="content" label="Content" /> <asset type="block" identifier="news-feed" label="Feed" /> </group> </system-data-structure>

And the page rendered in xml looks like this:
<system-data-structure> <Main-Content> <content><h1>OUR PAGE TITLE</h1></content> <news-feed> <content> <feed> ... <entry> ... </entry> </feed> </content> </news-feed> </Main-Content> </system-data-structure>

I am able to find the "content" node within "news-feed" using this:
<xsl:template match="Main-Content"> <xsl:apply-templates select="news-feed/content"/> </xsl:template>

However, I am not able to retrieve the "feed" node at the next level:
<xsl:template match="Main-Content"> <xsl:apply-templates select="news-feed/content/feed"/> </xsl:template>

What am I doing wrong?
Thanks,
Allie

  1. Support Staff 1 Posted by Tim on 04 Jun, 2010 03:20 PM

    Tim's Avatar

    Hi Allie,

    Are you able to attach your entire XSLT Format along with the XML that is generated for the page in question?

  2. Support Staff 2 Posted by Tim on 04 Jun, 2010 04:09 PM

    Tim's Avatar

    In your XSLT, try changing line 18 from <xsl:template match="news-feed/content/feed"> to: <xsl:template match="feed">

    Let me know if that helps.

  3. 3 Posted by Allie on 04 Jun, 2010 04:31 PM

    Allie's Avatar

    I am still not getting the content. The changed xslt format is attached.

  4. 4 Posted by Kris on 04 Jun, 2010 04:40 PM

    Kris's Avatar

    I think your issue is that you got a copy-of content, but then refer to its parent news-feed in your apply-templates selector. Try just using select="feed" there and keep your template match="feed" and I think you should be ok. I did not test this but hope it helps.
     
    Kris

  5. 5 Posted by Allie on 04 Jun, 2010 06:09 PM

    Allie's Avatar

    Hi Kris,
    The copy-of content refers to a different node, not the "content" node on the "news-feed" stream. I did try what you suggested, but it did not work.
    Thanks for trying to help :-)

  6. Support Staff 6 Posted by Tim on 04 Jun, 2010 07:57 PM

    Tim's Avatar

    I took a closer look at your XML and it looks like the <feed> element has a different namespace. You'll probably need to make a few adjustments to your XSLT in order for this to work.

    First, try adding that namespace to your stylesheet by changing:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    to this:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:z="http://www.w3.org/2005/Atom">

    Then, around line 17 or so when you apply-templates on the feed elements, try doing this:
    <xsl:apply-templates select="z:feed"/>

  7. 7 Posted by Allie on 04 Jun, 2010 08:11 PM

    Allie's Avatar

    Thanks much, Tim! You are right, I too see that namespace now. It works now by adding the namespace. Is there a sample atom2xml xslt in Cascade? I read it somewhere that there should be a sample file in the installation. I recently updated to 6.4.1 and do not see any such file in the installation. Thanks again.

  8. Support Staff 8 Posted by Tim on 04 Jun, 2010 08:19 PM

    Tim's Avatar

    Good deal. I'm not aware of any atom2xml samples. The closest thing would probably be our sample rss2xhtml Format, but it would not work for the atom feed in this post. I'll attach it here anyways so you can see.

  9. Tim closed this discussion on 04 Jun, 2010 08:19 PM.

  10. Allie re-opened this discussion on 04 Jun, 2010 08:23 PM

  11. 9 Posted by Allie on 04 Jun, 2010 08:23 PM

    Allie's Avatar

    Thanks for everything!

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac