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.  tag remove log from XML output

    Posted Sun February 26, 2017 02:58 PM

    Hi,I need some help.

    I have input XML…depend on the logic output xml will be generated.

    based on condition while mapping under LOOP. We do not want some tag in output xml.

    but I am getting empty tag in output. (line 3 and 4 are empty tags)

    <?xml version="1.0"?> Mr. C Mexciko 10000 PM

    in the documentToXMLString step I,set “generateRequiredTags=false” and give document name in ‘documentTypeName’ field.

    Still empty tags are coming…

    Could you please suggest how to remove those empty tag.’

    Thanks,
    Nabanita


    #webMethods
    #webMethods-General
    #Integration-Server-and-ESB


  • 2.  RE: tag remove log from XML output

    Posted Mon February 27, 2017 05:41 AM

    Hi Nabanita,

    can you provide an outline of your transformation logic please?

    Assuming Emp is a list, where is not clear which ones and how many of the entries are empty you should do the following:

    Loop over the list Emp and only map the entries if “Emp is not empty” via BRANCH.

    Regards,
    Holger


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-General


  • 3.  RE: tag remove log from XML output

    Posted Thu March 02, 2017 02:14 PM

    try to create a xslt service with this, it will filter empty nodes for you:

    <?xml version="1.0" encoding="UTF-8"?>

    <xsl:stylesheet version=“2.0” xmlns:xsl=“XSLT Namespace”>
    <xsl:output method=“xml”/>
    <xsl:template match=“/”>
    <xsl:apply-templates select=““/>
    </xsl:template>
    <xsl:template match=”
    ”>
    <xsl:if test=“.!=‘’”>
    xsl:copy
    <xsl:copy-of select=“@*”/>
    xsl:apply-templates/
    </xsl:copy>
    </xsl:if>
    </xsl:template>
    </xsl:stylesheet>


    #Integration-Server-and-ESB
    #webMethods-General
    #webMethods


  • 4.  RE: tag remove log from XML output

    Posted Fri March 03, 2017 05:18 AM

    Hi,

    The document you are using to generate the output has those fields defined (even if empty) or set as null?

    Are those fields set as required=true in the original document type?

    I don’t know if there is a better way, but before converting to XML, you could use a BRANCH operation on that field and use a MAP operation to drop the field from the document if it’s empty (leave the label empty) or if it’s null (another operation whose label is set to $null).

    Best Regards,


    #Integration-Server-and-ESB
    #webMethods-General
    #webMethods


  • 5.  RE: tag remove log from XML output

    Posted Mon November 20, 2017 06:07 AM

    Many thanks


    #webMethods-General
    #webMethods
    #Integration-Server-and-ESB