Character limit on string variables?

I'm using ASP 3.0 with javascript.

I have code that produces a long xml string.  My variable (which is called xml) is set like this...

var xml='';

I then go through the process of assigning the xml to it.

When complete I can view the length of the xml variable like this...

Response.Write(xml.length);

And it tells me it's a bit over 20 thousand characters.

That's all fine but when I try to actually view the xml string only an empty string is returned.

I have an sql server stored procedure that accepts xml as a parameter and i'm trying to parse this xml to the stored procedure.  But I can't seem to do anything with it.

Any ideas?
LispAsked:
Who is Participating?
 
Anthony PerkinsConnect With a Mentor Commented:
>>That's all fine but when I try to actually view the xml string only an empty string is returned.<<
It may be because IIS is interpreting the Xml document as HTML.
0
 
LispAuthor Commented:
The assignment at the end looks like this...

SQL = "exec MyStoredProcedure '" + xml + "'";

but the litteral string produced looks like this..

exec MyStored Procedure ''

I've done this many times in other languages and in asp .net.
0
 
LispAuthor Commented:
Sorry, litteral string looks more like this...

exec MyStoredProcedure ''
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
ddelhezCommented:
If you are programming in ASP,

var doesn't exist, it's dim to declare a variable
and to ask the length of a string it is
Response.Write(Len(xml))

and there is no semi-column at the end of lines...
0
 
Anthony PerkinsCommented:
ddelhez,

>>If you are programming in ASP<<
The questioner is using JScript (not VBScript) on ASP.  ASP is a platform not a language.
0
 
LispAuthor Commented:
Apologies for the delay.  I must have forgotten to come back and award the points.  The xml was indeed being interpreted as html in the page... so it wasn't the code that was flawed, only the means of testing it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.