Error in &ouml ; Encode
-
Hi all I have the following situation a XML text is send over a URL too a webservice. The XML is URLencoded on the other side. But when I read that into a xmlDom object it wont work, because of the & ; characters, i want to 'decode' this, Please help me for that
dim strtext: strtext = "< streetname > Baron van Hövelllaan < / streetname > " response.write ParseXML(strtext) function ParseXML(strXML) dim oXMLDom, i Set oXMLDom = Server.CreateObject("MSXML2.DOMDocument") call oXMLDom.loadXML (strXML) if trim(oXMLDom.xml) = "" then err.Raise 1004, "ParseXML", "XMLDOM content empty" end if ParseXML = true end function
The Stifler -- Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.
-
Hi all I have the following situation a XML text is send over a URL too a webservice. The XML is URLencoded on the other side. But when I read that into a xmlDom object it wont work, because of the & ; characters, i want to 'decode' this, Please help me for that
dim strtext: strtext = "< streetname > Baron van Hövelllaan < / streetname > " response.write ParseXML(strtext) function ParseXML(strXML) dim oXMLDom, i Set oXMLDom = Server.CreateObject("MSXML2.DOMDocument") call oXMLDom.loadXML (strXML) if trim(oXMLDom.xml) = "" then err.Raise 1004, "ParseXML", "XMLDOM content empty" end if ParseXML = true end function
The Stifler -- Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.
-
Thanks but i m not getting proper out put :confused: m working with ASP 3.0 i tried this one but the view sorce still display ö
function URLDecode(sText) sDecoded = sText Set oRegExpr = Server.CreateObject("VBScript.RegExp") oRegExpr.Pattern = "%[0-9,A-F]{2}" oRegExpr.Global = True Set oMatchCollection = oRegExpr.Execute(sText) For Each oMatch In oMatchCollection sDecoded = Replace(sDecoded,oMatch.value,Chr(CInt("&H" & Right(oMatch.Value,2)))) Next URLDecode = sDecoded End function ' XML string dim strtext: strtext = "<streetname>Baron van Hövelllaan</streetname> response.write URLDecode(URLDecode(Server.HTMLEncode(Server.URLEncode(strtext)))) function ParseXML(strXML) dim oXMLDom, i Set oXMLDom = Server.CreateObject("MSXML2.DOMDocument") call oXMLDom.loadXML (strXML) if trim(oXMLDom.xml) = "" then err.Raise 1004, "ParseXML", "XMLDOM content empty" end if ParseXML = true end function
The Stifler -- Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.
-
Thanks but i m not getting proper out put :confused: m working with ASP 3.0 i tried this one but the view sorce still display ö
function URLDecode(sText) sDecoded = sText Set oRegExpr = Server.CreateObject("VBScript.RegExp") oRegExpr.Pattern = "%[0-9,A-F]{2}" oRegExpr.Global = True Set oMatchCollection = oRegExpr.Execute(sText) For Each oMatch In oMatchCollection sDecoded = Replace(sDecoded,oMatch.value,Chr(CInt("&H" & Right(oMatch.Value,2)))) Next URLDecode = sDecoded End function ' XML string dim strtext: strtext = "<streetname>Baron van Hövelllaan</streetname> response.write URLDecode(URLDecode(Server.HTMLEncode(Server.URLEncode(strtext)))) function ParseXML(strXML) dim oXMLDom, i Set oXMLDom = Server.CreateObject("MSXML2.DOMDocument") call oXMLDom.loadXML (strXML) if trim(oXMLDom.xml) = "" then err.Raise 1004, "ParseXML", "XMLDOM content empty" end if ParseXML = true end function
The Stifler -- Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.
You know I didn't even spot that you are using Ladies ASP :-) Mmm: dredging memory for antiquated code... Try escape(strText) I think that might do it.
-
You know I didn't even spot that you are using Ladies ASP :-) Mmm: dredging memory for antiquated code... Try escape(strText) I think that might do it.
Hi thanks as i want to send that XML to ParseXML function Response.Write ParseXML (strText) Response.Write ParseXML(URLDecode(Server.URLEncode(URLDecode(Server.HTMLEncode(Server.URLEncode(strtext)))))) it gives error message as XMLDOM content empty
The Stifler -- Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.
-
Hi thanks as i want to send that XML to ParseXML function Response.Write ParseXML (strText) Response.Write ParseXML(URLDecode(Server.URLEncode(URLDecode(Server.HTMLEncode(Server.URLEncode(strtext)))))) it gives error message as XMLDOM content empty
The Stifler -- Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.
Have you tried: strText = ParseXML(escape(strText)) Response.Write(strText) Sorry, it's been quite a while since I used asp classic so might not be exact but should be close enough for you to work it out on your own. Perhaps someone else with more recent experience can step in here?