Select the search type
  • Site
  • Web
Search
You are here:  Support/Forums
Support

Bring2mind Forums

[Information] Using the custom attributes of DMX's RSS thought XSLT
Last Post 05/12/2010 9:37 PM by Peter Donker. 4 Replies.
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
DotNetNuke France
New Member
New Member
Posts:10


--
05/11/2010 7:31 PM

 Hi,

A few days ago I wondered how to access the value of the custom attributes as they are now present in the DMX's RSS XML. There is a bug in the way the NewsFeed module handles the namespaced nodes (required for the custom attributes), so I recommend you to use the XML native module until the bug gets corrected.

Here is an XSLT to load with a module XML (and not News Feed) which will access the 3 first custom attribute of the DMX's RSS.

The XSLT also contains a XSL parameter "ItemsToShow" which should be configured in the XML module's settings, in order to set the number of items to display without having to access the XSLT file itself.

Enjoy
Sébastien

 

DotNetNuke France
New Member
New Member
Posts:10


--
05/11/2010 7:33 PM

 

DotNetNuke France
New Member
New Member
Posts:10


--
05/11/2010 7:37 PM

 

DotNetNuke France
New Member
New Member
Posts:10


--
05/11/2010 7:38 PM
< ?xml version="1.0"? >
< xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dmx="http://www.bring2mind.net/dmx" >
  < xsl:output method="html" indent="yes"/ >
  < xsl:param name="ItemsToShow"/ >
  < xsl:template match="rss" >
    < table summary="DMX RSS Table" >
      < thead >
        < tr >
          < th scope="col" > < span >Custom attribute I< /span > < /th >
          < th scope="col" > < span >Custom attribute II< /span > < /th >
          < th scope="col" > < span >Custom attribute III< /span > < /th >
        < /tr >
      < /thead >
      < tbody >
        < xsl:for-each select="channel/item[position()&lt;=$ItemsToShow or $ItemsToShow&lt;1]" >          
          < tr >
            < td >< xsl:value-of select="dmx:att2" / >< /td >
            < td >< xsl:value-of select="dmx:att3" / >< /td >
            < td >< xsl:value-of select="dmx:att4" / >< /td >
          < /tr >
        < /xsl:for-each >
      < /tbody >
    < /table >
  < /xsl:template >
< /xsl:stylesheet >
 
Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
05/12/2010 9:37 PM
Thanks for that, Sebastien. I know XML is a bit tricky in this forum.

Peter
You are not authorized to post a reply.