Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

XML Workshop XX - Generating an RSS 2.0 Feed with TSQL(SQL server 2000) Expand / Collapse
Author
Message
Posted Wednesday, June 18, 2008 4:00 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, February 10, 2009 4:06 AM
Points: 6, Visits: 28
Thanks for your suggestion, the result of this test is incredible :

With a SELECT the 0x00 character is not present and after use a FOR XML EXPLICIT the 0x00 character magically appears at the end of a CDATA element like this
...0x00]]><...

I tried to force other column to CDATA but nothing appends.
The column which cause this problem have as Data Type text, and store HTML code.

have you already see that ?
Post #518852
Posted Wednesday, June 18, 2008 4:03 AM
SSC-Addicted

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

Group: General Forum Members
Last Login: Tuesday, December 24, 2013 4:42 AM
Points: 460, Visits: 2,523
could you post some script that reproduces the problem?

.
Post #518854
Posted Wednesday, June 18, 2008 5:42 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, February 10, 2009 4:06 AM
Points: 6, Visits: 28
The SELECT :
SELECT
1 as Tag,
null as Parent,
[NewsTitle],
[NewsSummary],
LEFT(DATENAME(dw, [NewsDate]),3) + ', ' + STUFF(CONVERT(nvarchar,[NewsDate],113),21,4,' GMT')
FROM [sd_News] WHERE [IDChannel] = '11'

With the FOR XML :
SELECT
1 as Tag,
null as Parent,
[NewsTitle] as [item!1!title!ELEMENT],
[NewsSummary] as [item!1!description!CDATA],
LEFT(DATENAME(dw, [NewsDate]),3) + ', ' + STUFF(CONVERT(nvarchar,[NewsDate],113),21,4,' GMT') as [item!1!pubDate!ELEMENT]
FROM [sd_News] WHERE [IDChannel] = '11'

FOR XML EXPLICIT

After some tests, it seems that the problem occurs when the HTML data store in the column NewsSummary is very important.

Regards.
Post #518898
Posted Wednesday, June 18, 2008 10:20 AM
SSC-Addicted

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

Group: General Forum Members
Last Login: Tuesday, December 24, 2013 4:42 AM
Points: 460, Visits: 2,523
Hi,
It does not really help because I have no way to run it and see the problem. Meanwhile, my only guess is that something is going wrong with your REPLACE() function. You should be able to remove a character by using the REPLACE() function correctly.


.
Post #519243
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse