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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  amp in an XML

    Posted 01/08/04 06:04 PM

    Hi,

    I have a question about & being transmitted in a XML from a sendor to a vendor. Should the conversion from & to & be made by the sender or the receiver. Also is there a standard document on the web that states it.

    Thanks,

    Gamad


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


  • 2.  RE: amp in an XML

    Posted 01/08/04 09:02 PM

    I’m not sure what you are asking.

    When in an XML file the & must be a & or it must be in a CDATA or processing instruction or Comment section [1], otherwise you don’t have XML. Whoever creates the XML should create legal XML. For instance, if you use IS 4.6 pub.web:recordToDocument to create the XML and there are & in the data, you should set the encode parameter to true.

    Whoever takes data out of XML should unencode or allow the application to un-encode it. For instance, if you use IS 4.6 pub.web:queryDocument to get text from a parsed XML document, the text will be decoded before being put into the pipeline.

    HTH,
    Fred

    [1] [url=“Extensible Markup Language (XML) 1.0 (Fifth Edition)”]Extensible Markup Language (XML) 1.0 (Fifth Edition)


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


  • 3.  RE: amp in an XML

    Posted 01/08/04 09:30 PM

    Hi Fred,

    The question that i had was Can a Sender (A) post an XML
    <a > Test & Test </a> to receiver (B), who if required converts the & to &
    Is there a strict rule that A should send it as

    1. <a > Test & Test </a> (B does the conversion if required) or
    2. <a > Test & Test </a> (A does the conversion)
      only or it depends upon the understanding between the sender and receiver (as to who will convert it from & to &
      and both xmls (1 and 2) are valid.

    Thanks in advance,

    Gamad


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


  • 4.  RE: amp in an XML

    Posted 01/08/04 10:04 PM

    The rule is that to have a “well formed” and “valid” XML document the ampersand “&” must be formatted properly.

    No formatting equals an invalid document.


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


  • 5.  RE: amp in an XML

    Posted 01/08/04 10:14 PM

    What Jim and I are saying is that “post an XML <a > Test & Test </a> to receiver (B)” is not possible because “<a > Test & Test </a>” is not XML. So the direct answer is “the Sender has to encode the data into XML before sending XML”.

    If the XML text is not encoded correctly, most parsers will exception when parsing the XML, so receiver B will never have a chance to get any of the data. I don’t know of any parsers that would allow ignoring or turning off this kind of XML syntax check.


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


  • 6.  RE: amp in an XML

    Posted 01/09/04 05:23 PM

    Hi Fred and Jim,

    Thanks for your help.
    So to confirm The characters & <> ’ " must be encoded before transmitting.
    Let me know if there any other characters that need to be transmitted.

    Thanks,

    Gamad


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


  • 7.  RE: amp in an XML

    Posted 01/09/04 06:36 PM

    There is predefined set of entities in the XML Spec for less than, greater than, amp, apos, quot.

    See [url=“Extensible Markup Language (XML) 1.0 (Fifth Edition)”]Extensible Markup Language (XML) 1.0 (Fifth Edition)


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