Returning strings containing XML/HTML from Web service call to SOAP::Lite 2005-02-16 - By Jones, Douglas 1
Back Mike,
Thank you for pointing that out...the only reason I didn't mention any Java functions that would serve the purpose is because I figured the find/replace would have to be done in perl since that is the client.
-- Doug Jones Co-Op Web Developer douglas.1.jones@(protected)
-- --Original Message-- -- From: A mailing list for Java(tm) 2 Platform, Enterprise Edition [mailto:J2EE-INTEREST@(protected)]On Behalf Of Michael New Sent: Tuesday, February 15, 2005 4:17 PM To: J2EE-INTEREST@(protected) Subject: Re: Returning strings containing XML/HTML from Web service call to SOAP::Lite
Jones, Douglas 1 wrote: > I ran into a similar problem with SOAP, however it was using different > libraries in a different language. Unless this affecting a great many > characters that you can't predict, I would suggest creating a simple > find/replace method to search for '<', '>', etc. and replace them > with '<' and '>' and so on. > > The only other suggestion that I can offer is that here we use Apache > Axis to handle SOAP encoding in our Java environment and we are able to > return Strings containing XML without the '<' and '>' characters being > encoded. >
String now has a replaceAll method:
replaceAll
public String replaceAll(String regex, String replacement)
Replaces each substring of this string that matches the given regular expression with the given replacement.
An invocation of this method of the form str.replaceAll(regex, repl) yields exactly the same result as the expression
Pattern.compile(regex).matcher(str).replaceAll(repl)
Parameters: regex - the regular expression to which this string is to be matched Returns: The resulting String Throws: PatternSyntaxException - if the regular expression's syntax is invalid Since: 1.4 See Also: Pattern
Mike New -- ---- ---- ---- ---- ------ _/ /\/\ /\/ -- ---- ---- ---- ---- --- J. Michael New mailto:mike@(protected) 1-613-796-0652 http://www.noozoo.com/
- Michael New is absolutely right and Bill Clinton is absolutely wrong. - Pat Buchanan -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
|
|