IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Special Characters

    Posted Thu September 27, 2007 09:12 PM

    Hi,
    we have the requirement to scrub the special characters like ",<,> . when i tried to implement this using pub.string:replace , i am not getting the expected result.

    i entered Instring as "PICK PACK and HOLD. ORDER CANNOT SHIP UNTIL 9/27/07
    i set the remaining parameters as follows

    Search string → [",>,<]
    replace string —>
    useRegex-------> true

    and the output in the pipe line is PICK PACK and HOLD. ORDER CANNOT SHIP UNTIL 9/27/07

    i wondered why the second " is still exists in the output?. we are running on IS 6.5 with SP2 and Windows 2000

    i appreciate if anyone guide me through the solution

    Vasu


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 2.  RE: Special Characters

    Posted Thu September 27, 2007 09:19 PM

    The " has special meaning in a regular expression. Review the wM docs for regex syntax. You also probably should not be using the , character in your search expression, unless you really mean to remove commas.

    Are you doing this for XML? If so, this sort of search and replace is unnecessary.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: Special Characters

    Posted Fri September 28, 2007 04:07 AM

    Vasa,

    I had the same problem with the special characters. Add this two characters ",” and you will get your output.
    This would help if u are working with known characters.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 4.  RE: Special Characters

    Posted Tue October 02, 2007 08:54 PM

    Hi Reamon and Kerni,
    Nice to see your responses. I have solved this issue. It is a data issue. Actually the second special character is not a Double Quotes. it is some unknown character. it looks like the same as " but actually not. i just removed that character and replace that one with " and executed the service. it works for me this time.

    Is there any way of handling the unknown characters…? i am doing this for XML because instead of " some characters were coming in the XML.

    when using the service documentToXMLString i have selected the

    encode—>true
    enforcelegalXML-----> true

    Reamon-- is there any way otherthan this to populate the XML?
    Please let me know your comments on this one

    Vasu


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 5.  RE: Special Characters

    Posted Tue October 02, 2007 09:15 PM

    Setting encode to true will “scrub” the XML properly. There is no need at the XML level to do a search and replace yourself separately. Your sample will become "PICK PACK and HOLD. ORDER CANNOT SHIP UNTIL 9/27/07” in the resulting XML.

    Refer to [URL=“HTML Document Representation”]http://www.w3.org/TR/html4/charset.html[/URL] and [URL=“Character entity references in HTML 4”]http://www.w3.org/TR/html4/sgml/entities.html[/URL] for information about character entity references.

    I was mistaken about " being a special character in regex. It isn’t.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods