XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old March 20th, 2008, 01:40 PM
WhiteClaw48 WhiteClaw48 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 53 WhiteClaw48 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 29 m 25 sec
Reputation Power: 1
Darn "string literal was expected" error

Okay so I'm working on an RSS feed.

And I keep getting the error:

A string literal was expected, but no opening quote character was found. Error processing resource 'http://netstat.co...

<font face="Arial" size=2>
-------------------------^

I have a feeling it has something to do with my complex query. Because if I use a very simple query it works fine...but when I use the query I need it doesn't. Any help would be great!

Code:
<?xml version="1.0" encoding="ISO-8859-1"?><!--#include virtual="Connections/Net.asp" --><% Response.Buffer = true 
Response.ContentType = "text/xml"
   
Function ApplyXMLFormatting(strInput)
  strInput = Replace(strInput,"&", "&")
  strInput = Replace(strInput,"'", "'")
  strInput = Replace(strInput, ">", ">")
  strInput = Replace(strInput,"<","<")
 
  ApplyXMLFormatting = strInput
End Function   
%>

<rss version="2.0">

  <channel>
  <title>Current Alarm State</title>
  <link>http://netstattest.com</link>
  <description>The current alarm state</description>

<%
  Dim objConn
  Set objConn = Server.CreateObject("ADODB.Connection")
  objConn.ConnectionString = strConn
  objConn.Open
 
  Dim objRS, strSQL, strDesc 
  strSQL = "SELECT p1.source, p1.message, DATE_ADD(p1.cdate, INTERVAL p1.ctime HOUR_SECOND) as cdatetime FROM ala as p1 WHERE p1.ctime = (SELECT max(ctime) FROM ala WHERE source=p1.source AND cdate=p1.cdate) AND ( message LIKE '%Node Down%' OR message LIKE '%If Down%' OR message LIKE '%Address Down%' OR message LIKE '%Connection Down%' ) ORDER BY cdate DESC, ctime DESC LIMIT 2"
  Set objRS = objConn.Execute(strSQL)  

  Do While Not objRS.EOF
    strDesc = "<b>Alarm for " & objRS("source") & " on " & _
             objRS("cdate") & " EST</b><br>" & _
             objRS("message").Value %>
<item>
      <title><![CDATA[<%=ApplyXMLFormatting(objRS("message").Value)%> 
         (<%=ApplyXMLFormatting(objRS("source").Value)%>)]]>
      </title>
      <description><![CDATA[<%=ApplyXMLFormatting(strDesc)%>]]></description>
      <datePosted><![CDATA[<%=ApplyXMLFormatting(objRS("CDATE"))%>]]></datePosted>
    </item>
	    
		<%
    objRS.MoveNext
  Loop
  
  objRS.Close
  Set objRS = Nothing

  objConn.Close
  Set objRS = Nothing
  Set objConn = Nothing
%>
</channel>
</rss>

Reply With Quote
  #2  
Old March 24th, 2008, 09:26 AM
jkmyoung jkmyoung is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 474 jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 18 m 31 sec
Reputation Power: 52
Put the size in quotations
<font face="Arial" size="2">

Reply With Quote
  #3  
Old March 24th, 2008, 04:01 PM
WhiteClaw48 WhiteClaw48 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 53 WhiteClaw48 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 29 m 25 sec
Reputation Power: 1
Quote:
Originally Posted by jkmyoung
Put the size in quotations
<font face="Arial" size="2">


I said it has something to do with my query.

" <font face="Arial" size=2> " does not exist in my coding anywhere at all.

Reply With Quote
  #4  
Old March 26th, 2008, 10:40 AM
jkmyoung jkmyoung is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 474 jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 18 m 31 sec
Reputation Power: 52
Sorry, I assumed you could change the xml from your source, http://netstattest.com...
Is this not the case?

Then complain to the provider of the source, or preprocess the xml using xml tidy, or other such tool.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Darn "string literal was expected" error


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway