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

XML Parsing issue

  • 1.  XML Parsing issue

    Posted Wed March 29, 2006 01:32 PM

    Hi ,
    I am getting below error while i run service pub.xml:XMLStringtoNode ,passing an XML which is having " & " in values of one of the tags.


    com.wm.lang.flow.WattEvaluationException: com.wm.lang.xml.WMDocumentException: [ISC.0042.9325] Element is missing end tag


    Please suggest ,how can i handle such characters while XML parsing.
    For the same kind of issue a service HTMLDecode is available,can i use it ?

    Thanks


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


  • 2.  RE: XML Parsing issue

    Posted Wed March 29, 2006 02:19 PM

    Sid,

    I don’t think th e “&” is the issue. Make sure that there is an end tag for the “partnum” element.

    12345

    Mark


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


  • 3.  RE: XML Parsing issue

    Posted Wed March 29, 2006 02:25 PM

    Error clearly mentions that the end tag is missing. Add the and reprocess it. That should work.
    Thanks
    Jay


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


  • 4.  RE: XML Parsing issue

    Posted Wed March 29, 2006 05:37 PM

    Hi,
    Its not a TAG issue.The XML i am passing is having the proper end TAG.

    but its not parsing anything after “&”

    Below is kind of value it has.

    MS9501-&

    And so it not reading the closing tag of the line

    Please suggest ,what can be done.
    Thanks


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


  • 5.  RE: XML Parsing issue

    Posted Wed March 29, 2006 05:56 PM

    Is this the only “&” you are having in the XML string.


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


  • 6.  RE: XML Parsing issue

    Posted Wed March 29, 2006 11:06 PM

    Sid;
    It is an xml parser problem. It is not able to parse your & character. It is a special character issue. Need to use encoding and decoding special characters. Check if encoding input parameter set to UTF-8 helps. you can aslo use CDATA to ignore the content in tags. check other posts in the forum regarding special character issue.


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


  • 7.  RE: XML Parsing issue

    Posted Tue November 13, 2007 08:04 AM

    Sid,

    The escape characters like <, >, & etc… are changed to entity reference like <, >, & etc… when being parsed. So you are getting the correct value in MS9501-&. Just assign UTF-8 to ‘encoding’ and true to ‘isXML’ Service-in parameters of pub:xml:xmlStringToXMLNode.


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


  • 8.  RE: XML Parsing issue

    Posted Tue October 23, 2012 07:13 AM

    Does any one has got the solution for the issue raised by sid, advise soemthing that can be done within webMethods to handle the malformed xml


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


  • 9.  RE: XML Parsing issue

    Posted Tue October 23, 2012 05:31 PM

    Nothing can be reasonably done to handle malformed XML. It needs to be corrected at the source.

    I dunno if Sid’s issue was resolved–he never posted the complete XML for analysis and didn’t indicate whether or not a solution was found.

    If you’re facing similar issue, post the XML and someone may be able to determine what’s wrong and suggest a course of action.


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


  • 10.  RE: XML Parsing issue

    Posted Thu December 14, 2017 08:28 AM

    Hi

    I am facing the similar issue with pub.xml:queryXMLNode service, Tried even assigning UTF-8 to ‘encoding’ and true to ‘isXML’ Service-in parameters of pub.xml:xmlStringToXMLNode but still could not resolve the issue.

    Below is the sample XML:

    <?xml version="1.0"?>

    British
    Mahesh

    Sr. Manager, System Eng. & Data Center

    Error:
    com.wm.lang.flow.WattEvaluationException: com.wm.lang.xml.WMDocumentException: [ISC.0042.9332] Malformed entity reference: & Data Center

    Please try to help me in this regard.


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


  • 11.  RE: XML Parsing issue

    Posted Thu December 14, 2017 11:12 AM

    You can try two options:

    Write a custom java service to modify ‘&’ to ‘&’

    For the service pub.xml:documentToXMLString, you’ll need to set the service input parameter ‘encode’ to true for the functionality desired.

    See documentation "9-X_Integration_Server_Built-In_Services", for information about the input parameter ‘encode’ which states the following:

    "String Optional. Flag indicating whether to HTML-encode the data. Set this parameter to true if your XML data contains special characters, including the following:

    < > & " ’

    Set to:

    true - to HTML-encode the data.

    For example, the string expression 5 < 6 would be converted to 5 < 6, which is valid.

    false - to not HTML-encode the data. This is the default.
    For example, the string expression 5 < 6 would be converted to 5 < 6, which is invalid."

    Site set the input parameter ‘encode’, for service pub.xml:documentToXMLString, to ‘true’ and problem resolved.

    The ‘&’ is now converted correctly to "&.


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


  • 12.  RE: XML Parsing issue

    Posted Fri December 15, 2017 10:13 AM

    Hi Mahesh S,

    Are you generating XML string using built in service ? Try to use XML data as attached

    Thanks,
    Yogesh
    Capture.PNG


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