Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Error in &ouml ; Encode

Error in &ouml ; Encode

Scheduled Pinned Locked Moved Web Development
helpcomsysadmintoolsxml
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sachin Pimpale
    wrote on last edited by
    #1

    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&ouml;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.

    R 1 Reply Last reply
    0
    • S Sachin Pimpale

      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&ouml;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.

      R Offline
      R Offline
      R Giskard Reventlov
      wrote on last edited by
      #2

      UrlDecode?[^]

      me, me, me

      S 1 Reply Last reply
      0
      • R R Giskard Reventlov

        UrlDecode?[^]

        me, me, me

        S Offline
        S Offline
        Sachin Pimpale
        wrote on last edited by
        #3

        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&ouml;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.

        R 1 Reply Last reply
        0
        • S Sachin Pimpale

          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&ouml;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.

          R Offline
          R Offline
          R Giskard Reventlov
          wrote on last edited by
          #4

          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.

          me, me, me

          S 1 Reply Last reply
          0
          • R R Giskard Reventlov

            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.

            me, me, me

            S Offline
            S Offline
            Sachin Pimpale
            wrote on last edited by
            #5

            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.

            R 1 Reply Last reply
            0
            • S Sachin Pimpale

              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.

              R Offline
              R Offline
              R Giskard Reventlov
              wrote on last edited by
              #6

              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?

              me, me, me

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups