![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Manipulating XML REQUEST withing ASP Manipulating XML REQUEST withing ASPTo: NULL Date: 8/3/2005 5:26:00 PM Hi I have a problem with a customer's XML being submitting to me in a
non-well-format XML.
They said that there are 18 other partners who has been able to tweak the
XML to make it work.
So I guess here is my question, in ASP, when working with XML, how do you
handle non-well-formed XML documents on the "listener" response side?
Here's the scenerio:
Customer post XML Data to us (non-well-formed XML)
ie: <sites>
<mytag1>http://sonny.com/</mytag1>
<mytag2><![CDATA[http://google.com?search=hellow+world&language=EN]]></mytag2>
<mytag3>http://mysite.com/helloworld/?myvar1=123&myvar2=abc</mytag3>
</sites>
Looking at the XML data above the mytag1 and mytag2 are fully W3C XML
conformed XML syntax, however the mytag3 is NOT. there are 2 tags in XML
that are considered illegal characters in XML data, the "&" and the "<". In
our case it's the "&" that's giving us grief.
Ok continue on, the customer sends this messed up format to me and I open it
up with the MSXML DOM object and it bombs out. Because it can't load the
REQUEST XML.
Anyone know how to PULL the REQUEST value to a STRING variable? here are
some sample codes I've tried.
sample 1.
Set X = server.createobject("Microsoft.XMLDOM")
X.async = False
X.Load(REQUEST)
strXML = X.xml
Response.ContentType="text/xml"
Response.Write strXML
Sample 2.
strXML = cstr(REQUEST)
Response.ContentType="text/xml"
Response.Write strXML
Both doesn't work with the non-well-formed XML sent, Sample 2 doesn't work
regardless, however Sample 1 does work with a well structured XML document.
Anyone know how I can pull the XML from the REQUEST so that I can manipulate
the string and format it so that it is parsable by the XMLDOM?
Thanks,
Sonny
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
