Problem with ampersand in xml


XML & Web services: Problem with ampersand in xml

  1. Problem with ampersand in xml (2 messages)

    Hi All, I have a process that dynamically builds xml on the fly based on some request. This application uses entity reference to represent ampersand. (&) . Following is an example of the xml generated. var=xyz&sessionid=123 The problem arises when this xml is passed to some other system which flags it as not well formed due to the ampersand (&). Has any one encountered this problem before. Suggestions welcome

    Threaded Messages (2)

  2. solution[ Go to top ]

    solution is to enclose problematic part of code into <code woth &, <, >, ', " characters> see: for more info
  3. need to HTML[ Go to top ]

    the solution is to URL encode the data, which converts special chars (like &) into codes (eg '&' -> '&'). on the other end, the data needs to be unencoded google 'URL encode'