Topic
  • 5 replies
  • Latest Post - ‏2012-10-10T06:08:22Z by SindhuSriHarsha
SindhuSriHarsha
SindhuSriHarsha
4 Posts

Pinned topic MQ's Input received as "&" and not "&" is not accepted by MPGW

‏2012-10-08T08:42:20Z |
Hi ,

We have an already existing MPGW which is receiving and sending messages to MQ.
We have a request being received from MQ to process in our MPGW rules as :
<searchTerm>Pediatric & Perinatal</searchTerm>

But Datapower is not accepting the "&" and is not triggering rules for that.
Is there any way in which "&" can be directly received by MPGW by modifying any configurations??
Please let me know.
Updated on 2012-10-10T06:08:22Z at 2012-10-10T06:08:22Z by SindhuSriHarsha
  • SindhuSriHarsha
    SindhuSriHarsha
    4 Posts

    Re: MQ's Input received as "&#38;" and not "&amp;" is not accepted by MPGW

    ‏2012-10-08T08:46:29Z  
    MQ is sending as "&" and not "&".. typo error in the subject line.
    I need to know whether there is anyway a MPGW can handle directly "&" and not "&" as that is the character being received from MQ.
  • kenhygh
    kenhygh
    2255 Posts

    Re: MQ's Input received as "&#38;" and not "&amp;" is not accepted by MPGW

    ‏2012-10-08T13:31:58Z  
    MQ is sending as "&" and not "&".. typo error in the subject line.
    I need to know whether there is anyway a MPGW can handle directly "&" and not "&" as that is the character being received from MQ.
    The problem is that with that bare '&' symbol, what you're receiving is not valid XML. The application putting that message to MQ needs to fix this.

    OR, you can mark your MPGW as non-xml and do whatever you need to do.

    Ken
  • SindhuSriHarsha
    SindhuSriHarsha
    4 Posts

    Re: MQ's Input received as "&#38;" and not "&amp;" is not accepted by MPGW

    ‏2012-10-09T04:41:19Z  
    Thanks Ken,I tried Non-XML but it is not working for our scenario. I will check with the application from which MQ is receiving the message.
  • HermannSW
    HermannSW
    6647 Posts

    Re: MQ's Input received as "&#38;" and not "&amp;" is not accepted by MPGW

    ‏2012-10-09T05:23:57Z  
    Thanks Ken,I tried Non-XML but it is not working for our scenario. I will check with the application from which MQ is receiving the message.
    Hi Sindu,

    best is to make an application which "tries" to send XML send "correct" XML.

    Sometimes you may not have the sending application under control.
    Converting '&' to '&​amp;' then is required before parsing.
    You may need to change '<' to '&​lt;' in addition, from the XML spec:

    The ampersand character (&) and the left angle bracket (<) MUST NOT appear in their literal form, except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed elsewhere, they MUST be escaped using either numeric character references or the strings "&​amp;" and "&​lt;" respectively.
    http://www.w3.org/TR/REC-xml/#syntax

    Stylesheet ampify.xsl in a Transform Binary Action as 1st step in your processing rule might do what is needed (for '&') then, see:
    https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14675880#14675880

     
    Hermann<myXsltBlog/> <myXsltTweets/>
  • SindhuSriHarsha
    SindhuSriHarsha
    4 Posts

    Re: MQ's Input received as "&#38;" and not "&amp;" is not accepted by MPGW

    ‏2012-10-10T06:08:22Z  
    Thanks Herman, the amplify.xsl provided me more inputs on having ageneric XSLT for convertin & to & amp; and also for & lt;