I have created an ASP page that will "on the fly" create an XML feed from my MS SQL database and the contents within a specified table.
The Feed: http://www.rockwood.k1 2.mo.us/news/rss.asp
You won't be able to see the code, b/c it returns xml, so I copied it below.
The Problem:
I can get every value to return from the database except the value that goes into the "Descriptio n" tag in the xml. (Ex: title, link and date all return fine. The Database column called "Summary" is supposed to return into the "descriptio n" tag in the xml, but comes back empty - no error, just empty.)
The column value of "summary" is of datatype "ntext", but so is the "title" column, which returns just fine.
Example database record that it's pulling back:
http://www.rockwood.k1 2.mo.us/news/releases/displayfullstor y.asp?Key=932
In this example, it's pulling back the bold title as "title", the
italicized date as "date" and the story text as the "descriptio n" (which is coming back blank in the xml)
Full ASP code: -
<?xml version="1.0" encoding="ISO-8859-1"?>
-
<% Response.Buffer = true
-
Response.ContentType = "text/xml"
-
-
Function ApplyXMLFormatting(strInput)
-
strInput = Replace(strInput,"&", "&")
-
strInput = Replace(strInput,"'", "'")
-
strInput = Replace(strInput,"""", """)
-
strInput = Replace(strInput, ">", ">")
-
strInput = Replace(strInput,"<","<")
-
-
ApplyXMLFormatting = strInput
-
End Function
-
%>
-
-
<rss version="2.0">
-
<channel>
-
<title>News Releases from Rockwood School District</title>
-
<link>www.rockwood.k12.mo.us</link>
-
<description>The Rockwood School District is St. Louis County
-
largest public school system, serving about 22,000 students.As we
-
pursue our goal to provide a world-class education to all of our
-
students, we remain committed to continuous improvement and increased
-
student achievement. </description>
-
<language>en-us</language>
-
<copyright>Copyright 2006 Christopher Beeson
-
All Rights Reserved.</copyright>
-
-
<%
-
-
Dim strReferrer
-
strReferrer = Request.QueryString("strReferrer")
-
Dim intPage
-
Dim intPageCount
-
Dim intRecord
-
Dim itest
-
Dim Key
-
-
'Get current Date for AddNew Form
-
Dim CurrentDate
-
CurrentDate = Date
-
-
'Create and Open Connection Object
-
Set objConnection = Server.CreateObject("ADODB.Connection")
-
-
' Open the data source connection
-
objConnection.Open "dsn=Releases;uid=Removed;pwd=Removed;"
-
-
'Create and Open Recordset Object
-
set RsList = Server.CreateObject("ADODB.Recordset")
-
RsList.ActiveConnection = objConnection
-
RsList.CursorType = adOpenDynamic
-
'RsList.LockType = adLockOptimistic
-
RsList.Source = "MAIN"
-
RsList.Open
-
-
If Not rslist.EOF Then
-
Do Until rslist.EOF
-
-
%>
-
-
<item>
-
-
<title><%=ApplyXMLFormatting(RsList("title").Value)%></title><link>http://www.rockwood.k12.mo.us/news/releases/displayfullstory.asp?Key=<%=RsList("key")%></link><description><%=ApplyXMLFormatting(RsList("summary"))%></description><datePosted><%=ApplyXMLFormatting(RsList("date"))%></datePosted></item><%
-
rslist.MoveNext
-
Loop
-
End IF
-
-
%></channel></rss>
-
1 2872 iam_clint 1,208
Recognized Expert Top Contributor
change your function to display like this -
Function ApplyXMLFormatting(strInput)
-
strInput = Replace(strInput,"&", "&")
-
strInput = Replace(strInput,"'", "'")
-
strInput = Replace(strInput,"""", """)
-
strInput = Replace(strInput, ">", ">")
-
strInput = Replace(strInput,"<","<")
-
response.write strInput
-
response.end
-
ApplyXMLFormatting = strInput
-
End Function
-
%>
-
now because it ended the response you can see what exactly is happening since your description is calling the formatting function i can only think that this is where your problem is. if you have any more problems let me know.
on title your doing .value on description your not.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Philip D Heady |
last post by:
Ok, as some of you may know I'm an Oracle newbie w/ PHP. I'd rather use
MySQL but at the office here we use Oracle and boy do I have alot to learn.
I'm starting to hate it after using MySQL!!
--------------------------------------------------------------------------
1) Is there a similar statement using PHP/Oracle functions as below for
MySQL?
--------------------------------------------------------------------------
while (list...
|
by: LRW |
last post by:
I have an automated process which uploads a comma separated
spreadsheet (csv) and inserts it into a database:
$sql = "LOAD DATA INFILE '".$uploadfile."' INTO TABLE `tbl_tracking`
FIELDS TERMINATED BY ','".
"OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\n'".
"( `tr_trackno` , `tr_ordernum` , `tr_shipname` , `tr_shipaddr` ,
`tr_citystate` , `tr_zip` , `tr_weight` , `tr_method` , `tr_shipdate`
)";
|
by: LRW |
last post by:
For an e-commerce site, I'm wanting to have it pull 4 random images
for the front page from a select list of items from the DB.
I can get it to pull randomly and place the images, but I can't figure
out how to keep it from potentially repeating images; using the same
one more than once.
The best I can come up with is the following...which makes duplicates
a little less common, but certainly doesn't stop it.
I'm wondering what piece of...
|
by: middletree |
last post by:
I have a page where I allow the user to select one or more names of
employees to send an email to, which is sent automatically when the form is
submitted. I have a field called EmailSentTo, and if you sent it to Joe
Smith, then it stores the employee's number, 200, which is the PK of the
Employee table.
And there is, of course, another page which displays all the information
from that form I just submitted, so I want to display this new...
|
by: TG |
last post by:
I have a problem trying to get a value from textbox 1 and textbox 2.
If those two values match the data in the database then it has to
return a third corresponding value to a third textbox (or label) after
a user clicks a submit button. Basically, I am trying to allow users
to enter a value of weight in pounds in textbox 1 and a zip code in
textbox 2 then pulling the shipping amount from a courier's database
and returning that dollar...
| |
by: PuckInLA |
last post by:
I have a question. I have some data that I am pulling into a dataset
that needs to have each row of data emailed out. I got the email
funciton working great but its extracting that data that is becoming
the problem. I assume it would be in a loop, and to do that I am
guessing something like this:
for each item in dataset
extact row
email rowinfo
for next
|
by: Stewart |
last post by:
Hi there,
I have an Access database, which contains the details of company staff
and services. The plan is to extract data from this database onto our
forthcoming Intranet (no inserting, updating or deleting at this
point). The Intranet itself has been created in ASP.NET, using
Microsoft Visual Web Developer 2005.
My concern is that we will encounter a slow response when pulling data
from this Access database across the network...
|
by: scolivas |
last post by:
I have a query that is pulling from a table of 35000+ records But for some reason any records beyond 25999 are not coming thru.
The Table is a list employees - and thier assignments - so there are many records with the same employee - thus the 35000+ records.
When I pull the query - I get all employees numbered 25841 and below...but the ones that are numbered 26000+ won't show. I can filter for those individually on the table itself, but...
|
by: BobRoyAce |
last post by:
I am using Visual Studio 2008 w/ VB.NET.
For the database, I am using SQL Server 2005, which is running on a
dedicated server box.
I am creating a WinForms application for a client. It is run on any of
several employees' desktop PCs.
Now, they want to be able to "push" some of the data from the SQL
Server database up to a database on a website (also SQL Server 2005).
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |