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
Expand all | Collapse all

Handling special characters in XSLT transformation

  • 1.  Handling special characters in XSLT transformation

    Posted Tue May 01, 2007 05:50 PM

    Hi,

    The input XMl for transformSerialXML has some special characters such as ‘&’ and the XSLT transformation is throwing an error due to this. If I try encoding before stringtobytes then too its facing a problem.

    how the special characters can be handled.

    Current flow.

    stringtobytes
    transformSerialXML (output in bytes)
    bytestostring

    Thanks,
    Bharathi


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


  • 2.  RE: Handling special characters in XSLT transformation

    Posted Tue May 01, 2007 05:58 PM

    XML with characters such as &, <, > and others is not valid XML. Such characters need to be converted to “character entities” when the XML is created. For example, if & appears within a data element it must be represented as &. The process that is creating the XML needs to do this. If IS is being used the simplest way is to set the encode input parameter to true in the call to pub.xml:documentToXMLString.


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


  • 3.  RE: Handling special characters in XSLT transformation

    Posted Tue May 01, 2007 05:59 PM

    Try replacing special characters in XML string before tranforming using these encoding.

    & → &
    ‘ → '
    “ → "
    < → <

    → >

    Thanks,
    Siva


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


  • 4.  RE: Handling special characters in XSLT transformation

    Posted Tue May 01, 2007 06:31 PM

    setting encode input parameter to true in the call to pub.xml:documentToXMLString is the right approach to go and then call your existing flow stringtobytes etc…

    HTH,
    RMG


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


  • 5.  RE: Handling special characters in XSLT transformation

    Posted Tue May 01, 2007 07:12 PM

    The reason I recommended to replace with encoding strings was, I did experienced similar issue with IS 6.1

    My step after receiving XML document is to convert to String using pub.xml:documentToXMLString and set encoded to ‘true’. But, ‘&’ character still contained in xml string data causing transformation error. So, manually replaced special characters using mentioned procedure.

    Hope this answers.

    -Siva


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


  • 6.  RE: Handling special characters in XSLT transformation

    Posted Wed May 02, 2007 02:39 PM

    Setting encode in documenttoXMLString solved the problem.

    Thanks
    Bharathi


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


  • 7.  RE: Handling special characters in XSLT transformation

    Posted Tue June 26, 2007 11:58 AM

    Hi,

    Did anybody have a problem with British pound (£) ?

    The encoding in documentToXMLString didn’t work with this symbol.

    Thanks,

    Rodrigo


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


  • 8.  RE: Handling special characters in XSLT transformation

    Posted Wed May 08, 2013 02:08 PM

    Even I am also having the same problem with Registered trademark ®, copyright symbols ©.

    May I know how to handle this.

    Thanks.


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


  • 9.  RE: Handling special characters in XSLT transformation

    Posted Wed May 08, 2013 04:56 PM

    For these kind use the string:replace service function and handle it…not possible with HTML encoding etc…and tags.

    HTH,
    RMG


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


  • 10.  RE: Handling special characters in XSLT transformation

    Posted Thu May 09, 2013 03:27 AM