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.  Xslt generating empty html

    Posted Mon April 08, 2024 05:49 AM

    Hello,

    I am using the xslt service in Software AG Designer 10.11
    The stylesheet version is 2.0

    What I am trying to do is generate an html page from an xml string. Then I write it to a file location and send an e-Mail with the content as a file attachment.
    In debug mode, everything goes fine. I can write the html page away to a file location and send an e-mail with the html content.

    The problem is as follows:
    When the package is not in debug mode, the xml data is missing, so it basically writes only the html tags and the variable xml data is missing.

    Does anyone have any idea what is going wrong here?

    Kind regards,
    GvB


    #Service-Designer
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Xslt generating empty html

    Posted Mon April 08, 2024 06:04 AM

    Hi Giel,

    please check where the xml should come from when not running in debug mode.

    Please provide some samples together with xslt being used.

    Regards,
    Holger


    #Integration-Server-and-ESB
    #Service-Designer
    #webMethods


  • 3.  RE: Xslt generating empty html

    Posted Mon April 08, 2024 07:41 AM

    Hello Holger,

    I created an example based on xml coming directly from the pipeline:

    <?xml version="1.0" encoding="UTF-8"?> 001234567879 0018264513 5016882668 N DDA 2024-01-23 00:00:00 00:00:00 2024-01-17 00:00:00 00:00:00 012345 ShippingParty ShippingStreet ShippingPostalCode ShippingCity CC ConsignorParty NV ConsignorStreet 1 ConsignorPostalCode ConsignorCity CC Consignee GmbH ConsigneeStreet ConsigneePostalCode ConsigneeCity CC Volume 5076 kg Volume 6.96 cbm 80.000 PCE PartDescription KGM 2376.000 M3 2.160 40.000 PCE PartDescription KGM 2700.000 M3 4.800 Loading period: 2024-01-17 - 2024-01-17 Delivery period: 2024-01-17 - 2024-01-23 PT: Camião SR - Sem processo descarga NL: Vrachtwagen algemeen - Normaal ES: Cam. 28t-Semi Grande - No special processing EN: Truck general - No special processing PL: Ciężarówka ogólnie - Brak specj. przetw. DE: LKW Normalfahrzeug - Normalfahrzeug ohne Entladung FR: Camion general - Standard HU: Fuvar általában - Nincs spec. Eljárás IT: Camion generale - Normale tpw_link

    xslt:

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

    <xsl:stylesheet version=“2.0” xmlns:xsl=“XSLT Namespace”>
    <xsl:value-of select=“.” disable-output-escaping=“yes”/>
    <xsl:template match=“/”>





    table, tr, td {border: none;}





    <xsl:for-each select=“ShippingInstructions”>

    </xsl:for-each>
    Customer ReferenceShipper Reference
    <xsl:value-of select=“ConsignmentReferences/UCR”></xsl:value-of><xsl:value-of select=“ConsignmentReferences/ShipperReference”></xsl:value-of>













    <xsl:for-each select=“ShippingInstructions/ConsignmentInformation/ShippingParty”>







    </xsl:for-each>
    Verlader
    AddressId Name Street PostalCode City
    <xsl:value-of select=“AddressID”></xsl:value-of> <xsl:value-of select=“Name”></xsl:value-of> <xsl:value-of select=“Street”></xsl:value-of> <xsl:value-of select=“PostalCode”></xsl:value-of> <xsl:value-of select=“City”></xsl:value-of>






    <xsl:for-each select=“ShippingInstructions/ConsignmentInformation”>






    </xsl:for-each>
    LaadplaatsLosplaats
    AddressId<xsl:value-of select=“ConsignorParty/AddressID”></xsl:value-of>AddressId<xsl:value-of select=“ConsigneeParty/AddressID”></xsl:value-of>
    Name<xsl:value-of select=“ConsignorParty/Name”></xsl:value-of>Name<xsl:value-of select=“ConsigneeParty/Name”></xsl:value-of>
    Street<xsl:value-of select=“ConsignorParty/Street”></xsl:value-of>Street<xsl:value-of select=“ConsigneeParty/Street”></xsl:value-of>
    PostalCode<xsl:value-of select=“ConsignorParty/PostalCode”></xsl:value-of>PostalCode<xsl:value-of select=“ConsigneeParty/PostalCode”></xsl:value-of>
    City<xsl:value-of select=“ConsignorParty/City”></xsl:value-of>City<xsl:value-of select=“ConsigneeParty/City”></xsl:value-of>
    <xsl:value-of select=“ShipmentReadyDate/Date”></xsl:value-of><xsl:value-of select=“FixedDeliveryDate/Date”></xsl:value-of>















    <xsl:for-each select=“ShippingInstructions/GoodsItems/Items”>









    </xsl:for-each>
    GoodsItems
    Hoeveelheid PackagingCode PartDescription WeightUnitCode GrossWeight CubeUbitCode Volume
    <xsl:value-of select=“Quantity”></xsl:value-of> <xsl:value-of select=“PackagingCode”></xsl:value-of> <xsl:value-of select=“PartDescription”></xsl:value-of> <xsl:value-of select=“Weight/WeightUnitCode”></xsl:value-of> <xsl:value-of select=“Weight/GrossWeight”></xsl:value-of> <xsl:value-of select=“Cube/CubeUnitCode”></xsl:value-of> <xsl:value-of select=“Cube/CubicVolume”></xsl:value-of>






    <xsl:for-each select=“ShippingInstructions/GoodsItems/GoodsAdditionalSpecs”>

    </xsl:for-each>
    Maten en Gewichten (totaal)
    <xsl:value-of select=“Value”></xsl:value-of><xsl:value-of select=“UnitCode”></xsl:value-of>






    <xsl:for-each select=“ShippingInstructions/SpecialInstructions”>



    </xsl:for-each>
    Transport opmerkingen
    <xsl:value-of select=“.”></xsl:value-of>



    </xsl:template>
    </xsl:stylesheet>

    Br,
    Giel


    #Service-Designer
    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: Xslt generating empty html

    Posted Mon April 08, 2024 07:47 AM

    Hello Holger,

    xslt that I use:

    <?xml version='1.0' encoding='UTF-8'?>
    <xsl:stylesheet version='2.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
    <xsl:template match='/'>
    <!-- TODO: Auto-generated template -->
    <html>
    <head>
    <meta http-equiv='content-type' content='text/html; charset=UTF-8' />
    <style>
    table, tr, td {border: none;}
    </style>
    </head>
    <body>
    <table width='100%' style='border: 1px solid;'>
    <tr><td>Customer Reference</td><td>Shipper Reference</td><td></td><td></td></tr>
    <xsl:for-each select='ShippingInstructions'>
    <tr><td style='width:25%;'><xsl:value-of select='ConsignmentReferences/UCR'></xsl:value-of></td><td style='width:25%;'><xsl:value-of select='ConsignmentReferences/ShipperReference'></xsl:value-of></td></tr>
    </xsl:for-each>
    </table>
    <table>
    <tr height='10px'><td></td></tr>
    </table>
    <table width='100%' style='border: 1px solid;border-collapse: collapse;font-size:16px;'>
    <tr style='background-color:#eee;'><td colspan='5' style='font-weight:bold;'>Verlader</td></tr>
    <tr style='background-color:#eee;'>
    <td style='width:20%;'>AddressId</td>
    <td style='width:20%;'>Name</td>
    <td style='width:20%;'>Street</td>
    <td style='width:20%;'>PostalCode</td>
    <td style='width:20%;'>City</td>
    </tr>
    <xsl:for-each select='ShippingInstructions/ConsignmentInformation/ShippingParty'>
    <tr style='background-color:#eee;'>
    <td><xsl:value-of select='AddressID'></xsl:value-of></td>
    <td><strong><xsl:value-of select='Name'></xsl:value-of></strong></td>
    <td><xsl:value-of select='Street'></xsl:value-of></td>
    <td><xsl:value-of select='PostalCode'></xsl:value-of></td>
    <td><xsl:value-of select='City'></xsl:value-of></td>
    </tr>
    </xsl:for-each>
    </table>
    <table>
    <tr height='10px'><td></td></tr>
    </table>
    <table width='100%' style='border: 1px solid;'>
    <tr style='background-color:#eee;'><td colspan='2' style='font-weight:bold;width:50%;'>Laadplaats</td><td colspan='2' style='font-weight:bold;width:50%;'>Losplaats</td></tr>
    <xsl:for-each select='ShippingInstructions/ConsignmentInformation'>
    <tr><td width='10%'>AddressId</td><td width='40%'><xsl:value-of select='ConsignorParty/AddressID'></xsl:value-of></td><td width='10%'>AddressId</td><td width='40%'><xsl:value-of select='ConsigneeParty/AddressID'></xsl:value-of></td></tr>
    <tr><td width='10%'>Name</td><td width='40%'><xsl:value-of select='ConsignorParty/Name'></xsl:value-of></td><td width='10%'>Name</td><td width='40%'><xsl:value-of select='ConsigneeParty/Name'></xsl:value-of></td></tr>
    <tr><td width='10%'>Street</td><td width='40%'><xsl:value-of select='ConsignorParty/Street'></xsl:value-of></td><td width='10%'>Street</td><td width='40%'><xsl:value-of select='ConsigneeParty/Street'></xsl:value-of></td></tr>
    <tr><td width='10%'>PostalCode</td><td width='40%'><xsl:value-of select='ConsignorParty/PostalCode'></xsl:value-of></td><td width='10%'>PostalCode</td><td width='40%'><xsl:value-of select='ConsigneeParty/PostalCode'></xsl:value-of></td></tr>
    <tr><td width='10%'>City</td><td width='40%'><xsl:value-of select='ConsignorParty/City'></xsl:value-of></td><td width='10%'>City</td><td width='40%'><xsl:value-of select='ConsigneeParty/City'></xsl:value-of></td></tr>
    <tr><td width='10%'></td><td width='40%'><strong><xsl:value-of select='ShipmentReadyDate/Date'></xsl:value-of></strong></td><td width='10%'></td><td width='40%'><strong><xsl:value-of select='FixedDeliveryDate/Date'></xsl:value-of></strong></td></tr>			
    </xsl:for-each>
    </table>
    <table>
    <tr height='10px'><td></td></tr>
    </table>
    <table width='100%' style='border: 1px solid;'>
    <tr style='font-weight:bold;background-color:#eee;'><td colspan='7'>GoodsItems</td></tr>
    <tr>
    <td style='border-bottom:1px solid;'>Hoeveelheid</td>
    <td style='border-bottom:1px solid;'>PackagingCode</td>
    <td style='border-bottom:1px solid;'>PartDescription</td>
    <td style='border-bottom:1px solid;'>WeightUnitCode</td>
    <td style='border-bottom:1px solid;'>GrossWeight</td>
    <td style='border-bottom:1px solid;'>CubeUbitCode</td>
    <td style='border-bottom:1px solid;'>Volume</td>
    </tr>
    <xsl:for-each select='ShippingInstructions/GoodsItems/Items'>
    <tr>
    <td><xsl:value-of select='Quantity'></xsl:value-of></td>
    <td><xsl:value-of select='PackagingCode'></xsl:value-of></td>
    <td><xsl:value-of select='PartDescription'></xsl:value-of></td>
    <td><xsl:value-of select='Weight/WeightUnitCode'></xsl:value-of></td>
    <td><xsl:value-of select='Weight/GrossWeight'></xsl:value-of></td>
    <td><xsl:value-of select='Cube/CubeUnitCode'></xsl:value-of></td>
    <td><xsl:value-of select='Cube/CubicVolume'></xsl:value-of></td>
    </tr>
    </xsl:for-each>
    </table>
    <table>
    <tr height='10px'><td></td></tr>
    </table>
    <table width='100%' style='border: 1px solid;'>
    <tr style='font-weight:bold;background-color:#eee;'><td colspan='2'>Gewicht (totaal)</td></tr>
    <xsl:for-each select='ShippingInstructions/GoodsItems/GoodsAdditionalSpecs'>
    <tr><td width='10%'><xsl:value-of select='Value'></xsl:value-of></td><td><xsl:value-of select='UnitCode'></xsl:value-of></td></tr>
    </xsl:for-each>
    </table>
    <table>
    <tr height='10px'><td></td></tr>
    </table>
    <table width="100%" style="border: 1px solid;">
    <tr style="background-color:#eee;"><td style="font-weight:bold;">Transport opmerkingen</td></tr>
    <xsl:for-each select="ShippingInstructions/SpecialInstructions">
    <tr style="background-color:#eee;">
    <td><xsl:value-of select="."></xsl:value-of></td>
    </tr>
    </xsl:for-each>
    </table>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    

    #Integration-Server-and-ESB
    #Service-Designer
    #webMethods


  • 5.  RE: Xslt generating empty html

    Posted Mon April 08, 2024 07:48 AM

    Example of the xml from the pipeline

    <?xml version="1.0" encoding="UTF-8"?>
    <ShippingInstructions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <ConsignmentReferences>
    <UCR>001234567879</UCR>
    <ShipperReference>0018264513 5016882668</ShipperReference>
    </ConsignmentReferences>
    <ConsignmentInformation>
    <ConsignmentStatusCoded>N</ConsignmentStatusCoded>
    <DeliveryTermsCoded>DDA</DeliveryTermsCoded>
    <FixedDeliveryDate>
    <Date>2024-01-23</Date>
    <Time>00:00:00</Time>
    <TimeTill>00:00:00</TimeTill>
    </FixedDeliveryDate>
    <ShipmentReadyDate>
    <Date>2024-01-17</Date>
    <Time>00:00:00</Time>
    <TimeTill>00:00:00</TimeTill>
    </ShipmentReadyDate>
    <ShippingParty>
    <AddressID>012345</AddressID>
    <Name>ShippingParty</Name>
    <Street>ShippingStreet</Street>
    <PostalCode>ShippingPostalCode</PostalCode>
    <City>ShippingCity</City>
    <CountryCode>CC</CountryCode>
    </ShippingParty>
    <ConsignorParty>
    <Name>ConsignorParty NV</Name>
    <Street>ConsignorStreet 1</Street>
    <PostalCode>ConsignorPostalCode</PostalCode>
    <City>ConsignorCity</City>
    <CountryCode>CC</CountryCode>
    </ConsignorParty>
    <ConsigneeParty>
    <Name>Consignee GmbH</Name>
    <Street>ConsigneeStreet</Street>
    <PostalCode>ConsigneePostalCode</PostalCode>
    <City>ConsigneeCity</City>
    <CountryCode>CC</CountryCode>
    </ConsigneeParty>
    </ConsignmentInformation>
    <GoodsItems>
    <GoodsAdditionalSpecs>
    <SpecCode>Volume</SpecCode>
    <Value>5076</Value>
    <UnitCode>kg</UnitCode>
    </GoodsAdditionalSpecs>
    <GoodsAdditionalSpecs>
    <SpecCode>Volume</SpecCode>
    <Value>6.96</Value>
    <UnitCode>cbm</UnitCode>
    </GoodsAdditionalSpecs>
    <Items>
    <Quantity>80.000</Quantity>
    <PackagingCode>PCE</PackagingCode>
    <PartDescription>PartDescription</PartDescription>
    <Weight>
    <WeightUnitCode>KGM</WeightUnitCode>
    <GrossWeight>2376.000</GrossWeight>
    </Weight>
    <Cube>
    <CubeUnitCode>M3</CubeUnitCode>
    <CubicVolume>2.160</CubicVolume>
    </Cube>
    </Items>
    <Items>
    <Quantity>40.000</Quantity>
    <PackagingCode>PCE</PackagingCode>
    <PartDescription>PartDescription</PartDescription>
    <Weight>
    <WeightUnitCode>KGM</WeightUnitCode>
    <GrossWeight>2700.000</GrossWeight>
    </Weight>
    <Cube>
    <CubeUnitCode>M3</CubeUnitCode>
    <CubicVolume>4.800</CubicVolume>
    </Cube>
    </Items>
    </GoodsItems>
    <SpecialInstructions>Loading period: 2024-01-17 - 2024-01-17</SpecialInstructions>
    <SpecialInstructions> Delivery period: 2024-01-17 - 2024-01-23</SpecialInstructions>
    <SpecialInstructions></SpecialInstructions>
    <SpecialInstructions>PT: Camião SR - Sem processo descarga</SpecialInstructions>
    <SpecialInstructions>NL: Vrachtwagen algemeen - Normaal</SpecialInstructions>
    <SpecialInstructions>ES: Cam. 28t-Semi Grande - No special processing</SpecialInstructions>
    <SpecialInstructions>EN: Truck general - No special processing</SpecialInstructions>
    <SpecialInstructions>PL: Ciężarówka ogólnie - Brak specj. przetw.</SpecialInstructions>
    <SpecialInstructions>DE: LKW Normalfahrzeug - Normalfahrzeug ohne Entladung</SpecialInstructions>
    <SpecialInstructions>FR: Camion general - Standard</SpecialInstructions>
    <SpecialInstructions>HU: Fuvar általában - Nincs spec. Eljárás</SpecialInstructions>
    <SpecialInstructions>IT: Camion generale - Normale</SpecialInstructions>
    <SpecialInstructions></SpecialInstructions>
    <AdditionalInformation>
    <Code>tpw_link</Code>
    </AdditionalInformation>
    </ShippingInstructions>
    

    #webMethods
    #Service-Designer
    #Integration-Server-and-ESB


  • 6.  RE: Xslt generating empty html

    Posted Mon April 08, 2024 07:55 AM

    !NOTE:
    If you run the xsltService directly and put the sample xml into xmldata, you might get something like “Invalid byte 2 or 4-byte UTF-8 sequence; Line#: 88; Column#: 34”.
    This is not the case if you create a flow calling the xsltService, where you can set the encoding to UTF-8


    #Integration-Server-and-ESB
    #Service-Designer
    #webMethods


  • 7.  RE: Xslt generating empty html

    Posted Fri May 03, 2024 07:12 AM

    Hi,

    The problem has been solved by changing the special characters that where in the string e.g.
    &agrave to à, saving the file as proper UTF-8 and re-submit it.

    Br,


    #webMethods
    #Integration-Server-and-ESB
    #Service-Designer