SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
Search:  
 
 
        
Home       Members    Calendar    Who's On



XML Workshop XVIII - Generating an RSS 2.0 Feed with TSQL Expand / Collapse
Author
Message
Posted Tuesday, April 08, 2008 10:22 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: 2 days ago @ 1:12 PM
Points: 414, Visits: 2,250
Comments posted to this topic are about the item XML Workshop XVIII - Generating an RSS 2.0 Feed with TSQL

Jacob Sebastian, SQL Server MVP
http://beyondrelational.com/blogs/jacob/
Post #482034
Posted Wednesday, April 09, 2008 7:15 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, November 03, 2009 6:52 AM
Points: 2, Visits: 22
I got a challenge. The RSS 2.0 Google Base feed:
http://base.google.com/support/bin/answer.py?answer=58085&hl=en

It seemed like it would be easy using the following:
WITH XMLNAMESPACES (
'urn:http://base.google.com/ns/1.0' as "g"
)

however, the result repeats the namespace for each of the items.
item xmlns:g="urn:http://base.google.com/ns/1.0"


It appears to be well-formed, but I am unsure if Google will accept the feed with the extra namespace for each item. Do you know of another way to do this without the namespace getting repeated?

Post #482283
Posted Wednesday, April 09, 2008 7:18 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Monday, November 02, 2009 9:26 AM
Points: 3,280, Visits: 962
Good article. A new area to explore.

:)



Post #482288
Posted Wednesday, April 09, 2008 8:10 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: 2 days ago @ 1:12 PM
Points: 414, Visits: 2,250
I dont think a feed parser will complain for the namespace declaration on the item elements.

I had been writing another article on ATOM feed and realized that feed validators do not complain about the extra namespace declarations on the child elements.


Jacob Sebastian, SQL Server MVP
http://beyondrelational.com/blogs/jacob/
Post #482359
Posted Wednesday, April 09, 2008 8:34 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, November 03, 2009 6:52 AM
Points: 2, Visits: 22
Thanks Jacob. I will try to upload a feed and see if it they accept it.
Post #482389
Posted Wednesday, April 09, 2008 7:03 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, September 16, 2009 8:03 AM
Points: 132, Visits: 156
Fantastic article! This was a good read.

I may use this technique for my one of my websites. I use SQL2k5 and was going to integrate RSS feeds. This technique just gave me the info I was looking for.

-M
Post #482704
Posted Thursday, April 10, 2008 9:02 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, November 05, 2009 5:05 AM
Points: 84, Visits: 4,340
I've also enjoyed the article.

It's very clean to do that in this way. There's no need to do it in .NET
I also suppose that it performs much better...

Post #483104
Posted Wednesday, June 04, 2008 10:17 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, October 30, 2009 12:05 PM
Points: 199, Visits: 267
I like the article, it's very cool stuff. I'm just starting to look at RSS feeds, and this seems a very simple way to do it, without writing any ASP.net, though it seems if there is a login on your site, you might have too anyway.

My question is:How do I get my web page to see this view?. I run the SELECT statement at the end of your article, and a single item is generated, how do I turn that into a web page people see? I'm missing the final step about how to make this XML public, I guess.

Dan
Post #511544
Posted Wednesday, June 04, 2008 11:22 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: 2 days ago @ 1:12 PM
Points: 414, Visits: 2,250
You need to create a page that executes the TSQL code and returns the resultant XML to the HTTP response stream. The caller (usually an rss reader or a browser that understands how to display a feed) will identify the content type and will display the feed accordingly.

Jacob Sebastian, SQL Server MVP
http://beyondrelational.com/blogs/jacob/
Post #511601
Posted Tuesday, September 30, 2008 10:20 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: 2 days ago @ 1:12 PM
Points: 414, Visits: 2,250
One option is to write a .NET application that executes the query/stored procedure and writes the output to a file: http://www.sqlservercentral.com/articles/XML/62054/

Or use a command line utility like sqlcmd.exe etc that can generate a file with the output of a query.


Jacob Sebastian, SQL Server MVP
http://beyondrelational.com/blogs/jacob/
Post #578836
« Prev Topic | Next Topic »


Permissions Expand / Collapse