bear0053 has asked for the wisdom of the Perl Monks concerning the following question:
idea: split the incoming xml at the >DATA TO BE CONVERTED or WHITESPACE< and just call the convertchar method on the data between the >< I will need to be sure that i keep the xml syntax exactly how it should be. so based on my example $incoming_xml once the regex is run the converted xml should look like:$incoming_xml = ' <?xml version="1.0" encoding="UTF-8"?> <TRANSACTION> <FIELDS> <FIELD KEY="user">name</FIELD> <FIELD KEY="password">pass&word</FIELD> <FIELD KEY="operation_type"><do_what></FIELD> </FIELDS> </TRANSACTION>';
once converted i will send it through XMLin then i can loop through the resulting hash and convert the !# back to their original values therefore preserving the necessary bad values.$converted_xml = ' <?xml version="1.0" encoding="UTF-8"?> <TRANSACTION> <FIELDS> <FIELD KEY="user">name</FIELD> <FIELD KEY="password">pass!38word</FIELD> <FIELD KEY="operation_type">!40do_what!41</FIELD> </FIELDS> </TRANSACTION>';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex on XML
by mirod (Canon) on Feb 17, 2004 at 21:31 UTC | |
|
Re: regex on XML
by diotalevi (Canon) on Feb 17, 2004 at 19:51 UTC | |
|
Re: regex on XML
by CountZero (Bishop) on Feb 17, 2004 at 20:30 UTC | |
|
Re: regex on XML
by injunjoel (Priest) on Feb 18, 2004 at 01:56 UTC | |
by bear0053 (Hermit) on Feb 18, 2004 at 15:38 UTC | |
|
Re: regex on XML
by CountZero (Bishop) on Feb 17, 2004 at 20:55 UTC | |
by diotalevi (Canon) on Feb 17, 2004 at 21:09 UTC | |
by CountZero (Bishop) on Feb 17, 2004 at 22:57 UTC | |
by diotalevi (Canon) on Feb 17, 2004 at 23:07 UTC | |
by CountZero (Bishop) on Feb 18, 2004 at 07:29 UTC | |
|