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 FeedsAny custom transformation gives an error 'Data at the root level is invalid. Line 1, position 1'Any custom transformation gives an error 'Data at the root level is invalid. Line 1, position 1'
Previous
 
Next
New Post
10/20/2016 5:56 AM
 

We're using NewsFeeds module 5.00.01 on DNN 8.something and it has been working fine so long as we stick to the Default transformation.  Now we're trying to read a Google Alerts feed, which has <link> elements a little different to the norm. To do this we think we need a custom Transformation to handle the slightly unusual RSS feed syntax, but I find that even if I copy Default.xsl to the custom transformations folder it generates an error, even before I make my modifications.

I'm no RSS expert, but what I've seen is that most feeds come with a link element like:

<link>http://somewhere.com/foo</link>

While the Google Alerts feed has an element like this:

<link href="http://somewhere.com/foo"></link>

DesktopModules/News/Resources/Transformations/Default.xsl uses the link attribute like this:

<a href="{link}">

and this causes the <a> generated in the resultant feed to have an empty href attribute, so it simply links back to the current page instead of out to the news site.  I believe the syntax I should use is something like:

<a href="{link/@href}">

(but please correct me if I'm wrong!)  .. so I copy Default.xsl to Portals/0/NewsFeeds/Resources/Transformations/GoogleAlerts.xsl and make my minor modification, edit the feed and select GoogleAlerts.xsl from the Feed Transformation dropdown, and immediately the feed fails to render, and this is logged in the Portal log file:

2016-10-20 09:53:09,693 [Server][Thread:18][ERROR] DotNetNuke.Services.Exceptions.Exceptions - FriendlyMessage="Feed errors:<br />Feed '<a href="https://www.google.com/alerts/feeds/18051535404781326719/17921738013404500860">https://www.google.com/alerts/feeds/18051535404781326719/17921738013404500860</a>' could not be loaded. Error: Download error (Data at the root level is invalid. Line 1, position 1.)<br />" ctrl="ASP.desktopmodules_news_rssmodule_ascx" exc="System.Exception: Feed Errors"

Changing the Transformation dropdown back to the original Default makes it immediately start rendering again.  Changing the feed URL doesn't help.  It's as if there is some fatal error reading any custom transformation xsl file.

Can anyone corroborate this experience, or suggest what we might be doing wrong?

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews FeedsAny custom transformation gives an error 'Data at the root level is invalid. Line 1, position 1'Any custom transformation gives an error 'Data at the root level is invalid. Line 1, position 1'


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.

Content Layout

Subscribe to DNN Digest

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2018 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out