Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews FeedsSelecting node from different namespace in XSL for-eachSelecting node from different namespace in XSL for-each
Previous
 
Next
New Post
10/30/2012 7:46 AM
 

Hi,

I've been successfully working with the News Feeds for quite a while now.
This week however, I ran into a problem: one of the nodes in my rss feed, has a custom namespace.
The node with the custom namespace is not returned, no matter what I try.

Example feed:
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:mailplus="http://api.mailplus.nl/rss/mailplus/">
   <channel>
       <item>
           <title>test</title>
           <link>www.google.com</link>
           <description>This is a test</description>
           <mailplus:image>
              <![CDATA[http://www.eredivisielivenieuwsbrief.nl/Portals/0/Images/Nieuws/ADO FC Groningen vierkant 2.jpg]]>
           </mailplus:image>
      </item>
  </channel>
</rss>

Example of my XSL file:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:mailplus="http://api.mailplus.nl/rss/mailplus/">
 <xsl:output method="html" indent="yes"/>
 <xsl:param name="ItemsToShow"/>
 <xsl:param name="ShowItemDetails"/>
 <xsl:param name="ShowItemDate"/>
 <xsl:param name="Locale"/>
 <xsl:param name="Target"/>
 <xsl:template match="rss">
 <ul class="RSS">
 
 <xsl:for-each select="channel/item">
  <xsl:sort select="position()" data-type="number" order="descending" />
  <xsl:if test="position()&lt;=$ItemsToShow or $ItemsToShow&lt;1">
  <li>
    <h3>
     <xsl:attribute name="target"><xsl:value-of select="$Target"/></xsl:attribute>
     <xsl:value-of select="title"/>
    </h3>
    <xsl:value-of select="./*[namespace-uri()='http://api.mailplus.nl/rss/mailplus/']" disable-output-escaping="yes"/>
   </li>
   </xsl:if>
  </xsl:for-each>
  </ul>
 </xsl:template>
</xsl:stylesheet>

Expected result:
Test
<![CDATA[http://www.eredivisielivenieuwsbrief.nl/Portals/0/Images/Nieuws/ADO FC Groningen vierkant 2.jpg]]>

Actual result:
Test

 I tested with multiple different select statements, for instance:
select="mailplus:image"
select="./mailplus:*"
select="./*[local-name()='image']"
select="./*[namespace-uri()='http://api.mailplus.nl/rss/mailplus/']"
select="./*[local-name()='image' and namespace-uri()='http://api.mailplus.nl/rss/mailplus/']"

However, none of these return anything.

I've been able to test these select statements successfully in the online parser at http://www.xpathtester.com/test. I do have to change the "./" in the select query to "//" when using the online parser, because I'm not using a for-each loop in that case.

Can anyone confirm that I'm on the right track, or point me to what I'm doing wrong?
I'm also starting to wonder if there could be a difference in the XSL parser used in the NewsFeeds module and in the online tool I'm using to test my select statements.

Thanks in advance for your suggestions.
Hanneke


										
 
New Post
10/30/2012 9:32 AM
 

After posting this question on StackOverflow, I got to know that my problem is not in the XSL file.

Apparently, the News Feeds module preprocesses the feed, which causes my node from the custom namespace to be deleted! I have confirmed this behavior by checking out the "Currently in Cache" field of the RSS feed settings, my custom tag is nowhere to be found in the cached version.

I tried setting up a custom preprocess XSL file, but I actually have no idea where to start. I tried modifying the existing RdfToRss20.xsl file from the module, but I can't get the custom node to return there either.

It seems to me that regardless of the "Feed Transformation" I select in the module settings, my custom tag is still deleted in some preprocessing.

Is it possible to disable the preprocessing, so that I can use my custom namespace tags in the News Feeds module?

Thanks in advance!

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews FeedsSelecting node from different namespace in XSL for-eachSelecting node from different namespace in XSL for-each


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out