06-30-04 11:01 PM
Hi Chris, thanks for the reply.
Let me try to rephrase my question.
I am trying to send 3 variables using Msxml2.ServerXMLHTTP.4.0
The first variable is the username, the second the password, and the last va
riable is a block of xml.
This process has been working fine, until I came across the & symbol.
I have many different systems running that are translating xml, so whenever
I have this problem it is just a matter of changing the character from & to
& (I'm not sure how this formatting will display in the newsgroups so I
format the & sign to & a m
p ;)
This usually does the trick. In this case it does not seem to have any effec
t and I still get an error from the web site I post the xml to. The error al
ways says the same thing; there is a problem with line X (where X is the lin
e with the & symbol).
From what I have gathered the problem isn't how I am sending the & chara
cter, because I know I am sending it properly formatted. But from the way Ms
xml2 posts my information.
This line:
xmlConnection.Send "user="+username+"&pass="+password+"&xml="+xmlData
In this line I am just connecting strings together. Could this be the proble
m?
Let's say my "username" variable was joe&bard
That line above would translate to:
xmlConnection.Send "user=joe&bard"&pass="+password+"&xml="+xmlData
And if my password value was pass2, and the xmlData was <xml></xml>
It would be fully translated as:
xmlConnection.Send "user=joe&bard&pass=pass2&xml=<xml></xml>"
So when the web server on the other side tries to get the value of "user" th
ey would only get "bard" as a response. Correct?
Even if the & sign was changed to & It would look like this:
xmlConnection.Send "user=joe&bard&pass=pass2&xml=<xml></xml>"
or (depending on newsgroup formatting)
xmlConnection.Send "user=joe&bard&pass=pass2&xml=<xml></xml>"
And (in either example) when the person requested the value of "user" they w
ould still only get "joe". That's because the & sign is forcing that variabl
e to end.
The same with the xml, the & sign, no matter if it is formatted or not (&, &
amp;, &) is forcing that variable to end.
This is what I am thinking is happening to my xml when I send it. What I nee
d to know is if there is a way to rewrite my xmlConnection.Send line so it d
oes not have all of the variables concatenated on a single string. Or a way
to eliminate this ampersand
problem?
[ Post a follow-up to this message ]
|