Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Manipulating XML REQUEST withing ASP

From: "SP" <sphimmasone@------------.--->
To: 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





transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent