Hi,
I am using technology:ASP with backend: sql server
I'm trying to get the sql query results in XML on my asp page, after a while or so, but i get an alert box saying
XML: a string literal was expected, but no opening quote character was found.
Any help, guidance, suggestion or solution will be greatly appreciated!
Thanks in advance,
Sush
8 27072
If this thread is not helpful please reply.
Also, check the XML to have always the attribute values quoted.
See this link.
Also, check the XML to have always the attribute values quoted.
See this link.
I have checked the quotes around the attributes in the XSL and they are all fine. So that doesn't seem to be the problem
How do you load the XML file or string?
Please include some sample code and XML data.
How do you load the XML file or string?
Please include some sample code and XML data.
ok, here is code, i have only removed "Get form variables" lines of code -
<%
-
Response.Buffer = true
-
Response.Expires=-1444
-
Response.CacheControl = "no-cache"
-
Server.ScriptTimeout=10000
-
Response.CharSet="windows-1252"
-
Response.ContentType="text/xml"
-
-
Dim oXMLOutput,oElement,oRs,oCn,iCount,sValue, sCols, iArrayCount, bExists, bLogonPracticeExists
-
-
Set oCn = server.CreateObject("ADODB.Connection")
-
Set oRs = server.CreateObject("ADODB.Recordset")
-
set oXMLOutput=server.CreateObject("MSXML2.DOMDocument")
-
-
'connect to the database
-
oCn.Open Application("gsConnection")
-
-
'fetch all the records into the recordset
-
set oRs=oCn.Execute("gs_get_riskoverview_revised '" & sCriteria & "','" & sData & "','" & sNT_ID & "','" & sStage & "','" & dtStart & "','" & dtEnd & "'")
-
-
'sPage name is passed from the corresponding pages from where this page is called through XMLHTTP
-
-
select case sPage
-
-
case "Overview"
-
-
sCols="CURRENT_STAGE,SORT_STAGE,SALES_PROSPECT_CODE,PARTNER_NAME,MANAGER_NAME,RAF_STATUS,LATEST_RAF,COMBINED_OVERALL_RISK,RESEND,ACTIONS"
-
-
sCols=split(sCols,",")
-
-
end select
-
-
'load the dom object
-
oXMLOutput.loadXML("<ROWS/>")
-
-
'used for inserting an attribute which is not present in the database
-
bExists=0
-
-
'used for checking the existence of logon users practice
-
bLogonPracticeExists=0
-
-
do while not oRs.EOF
-
Set oElement = oXMLOutput.createElement("ROW")
-
oXMLOutput.selectSingleNode("//ROWS").appendChild oElement
-
for iArrayCount=lbound(sCols) to ubound(sCols)
-
for iCount=0 to oRs.Fields.Count-1
-
if sCols(iArrayCount)=oRs.Fields(iCount).Name then
-
if oRs.Fields(iCount).Value=NULL or IsNull(oRs.Fields(iCount).Value) then
-
sValue=""
-
else
-
sValue=oRs.Fields(iCount).Value
-
end if
-
oElement.setAttribute oRs.Fields(iCount).Name,sValue
-
bExists=1
-
exit for
-
end if
-
next
-
if bExists=0 then
-
oElement.setAttribute sCols(iArrayCount),""
-
end if
-
'reset
-
bExists=0
-
next
-
-
'check if the logon user practice is present in the recordset
-
'if no then add it in the xml string
-
if sPage="PracticeLoc" or sPage="PracticeGlob" then
-
if oRs("UNIT_CODE")=sPracticeCode then
-
bLogonPracticeExists=1
-
end if
-
end if
-
oRs.MoveNext
-
loop
-
-
'if the flag bLogonPracticeExists=0 then the recordset has not retrieved
-
'the logon users practice hence added it to the xml string
-
if (sPage="PracticeLoc" or sPage="PracticeGlob") and bLogonPracticeExists=0 then
-
Set oElement = oXMLOutput.createElement("ROW")
-
oXMLOutput.selectSingleNode("//ROWS").appendChild oElement
-
oElement.setAttribute "UNIT_CODE",sPracticeCode
-
oElement.setAttribute "UNIT_NAME",sDescription
-
end if
-
-
%>
-
<?xml version="1.0" encoding="windows-1252"?>
-
<%
-
Response.Write oXMLOutput.xml
-
-
set oXMLOutput=Nothing
-
set oCn=Nothing
-
set oRs=Nothing
-
%>
-
Just for test, try to remove the line (the header should be already set): -
%>
-
<?xml version="1.0" encoding="windows-1252"?>
-
<%
-
If no success, check carefully the formatting of oXMLOutput.xml string to be correct, because the server is not always adding quotes around the attributes.
Hi,
Did you succeed to solve the problem ?
If yes, please let me know, in order to close the thread.
Thanks,
Dorin.
Hi,
Did you succeed to solve the problem ?
If yes, please let me know, in order to close the thread.
Thanks,
Dorin.
No, I haven't been able to resolve this, the error occurs only when the number of rows returned by the sql query is more.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Mike |
last post by:
Does anyone know of a minimal/mini/tiny/small xml parser
in c? I'm looking for something small that accepts a stream
or string, builds a c structure, and then returns an opaque
pointer to that structure. There should then be a function
to search that structure given the pointer, tag, and an
optional attribute. I'm looking initially at only text data,
no numbers, though eventuall there will be some binary
data (CDATA?).
Thanks.
|
by: Robert M. Gary |
last post by:
I'm using JRE 1.5 on Solaris Japanese (Sparc). The JVM claims its default
character set is EUC-JP
I'm seeing two strange things when using Japanese character sets...
1) If I write a program that does
System.out.println("$^%$%^^" ); //assume those are Japanese characters that
are multibyte under EUC-JP
The resulting output looks NOTHING like the characters I typed in.
Apparently the character set being used to read the literal is...
|
by: herrcho |
last post by:
i'm in the course of learning C, and found these two words "string,
string literal" confusing me..
I'd like to know the difference between them.. Thank you
|
by: Guadala Harry |
last post by:
I need to place the following into a string... How can I properly escape the
% " / < and > characters?
<table width="100%" border="0" cellspacing="0" cellpadding="4px"
class="hfAll"></Table>
Thanks.
|
by: Jerome Cohen |
last post by:
AI am trying to call a third-party web service. this service expects an XML
fragment that contains the request plus other parameter. adding the web
reference created the syntax below(reference.vb).
I changed the data type for the structure that contains the XML data from
the default "String" to "xml.xmldocument" to enable easy filling of the
data.
my client code creates an XML document class, fills the data using standard
xml dom...
| |
by: Jonny |
last post by:
Hi,
I am trying to write a C function which will dequote the string in a
char * variable, and unescape any escaped quotes, so that, for example:
"hello"
would become:
hello
|
by: RdS |
last post by:
Hello,
I use sourcesafe and vb 2003 for my dev environment. on the sourcesafe
server I also have sql2005 and reporting services installed. The web app
references this sql server for db. When I compile the app on my local
machine which is used for development I am able to lauch application with no
problem. When I run my web app on my local machine which uses my IIS 5
(WinXP Pro) the application runs fine. But if I connect to server...
|
by: sushweta8 |
last post by:
Hi,
technology:ASP, backend: sql server
I'm trying to present the sql query results in XML on my asp page, but i get an alert box saying
XML: a string literal was expected, but no opening quote character was found.
when i run the query second or third time, i get the results in XML alright.
|
by: somenath |
last post by:
Hi All,
I was going through one piece of code which is written by an
experience programmer and it is working fine.
But I think the use of "strstr" is not proper because it may show
undefined behavior.
char *returnValueFromIniFile(char *iniFilePath,char *keyIntheFile)
|
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: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
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
| | |