in reply to Re^3: Semicolons in webforms
in thread Semicolons in webforms

Unfortunately I don't have any control over the client. The problem is that the client is intentionally sending the semicolon as a delimiter (its written in C#). The other issue is the xml string could be a very large xml string with many semicolons. Ideally, I'd be able to simply replace the semicolons with pipes. I'm not really looking to do name value pairs since I need to do further processing of the XML before I handled the data that is delimited with semicolons. Any other advise? Here is another example if this is helpful:
# this line represents the xml that I would receive from a client. $xmlstring = '<listofitems> <item> <itemid>1234</itemid> <itemname>genericname</itemname> <tablefield>1234;id</tablefield> </item> <item> <itemid>1235></itemid> <itemname>genericname2</itemname> <tablefield>1235;id</tablefield> <tablefield>1;specialtiem</tablefield> </item> </listofitems>';
In my program I would then parse the xml data into other variables. The problem is that when I attempt to parse the data the semicolon in the tablefield xml tag screws it up. TIA.

Replies are listed 'Best First'.
Re^5: Semicolons in webforms
by eserte (Deacon) on Dec 31, 2007 at 00:14 UTC
    The client may use the semicolon as some kind of internal separator for the XML data, but if the data goes through a HTTP-GET or urlencoded HTTP-POST request, then it must be properly escaped.