Hi @Mahesh Madhusanka,
I made the following modifications:
- Removed not needed
xmlns:tr=
`http://www.w3.org/1999/XSL/Transform` namespace declaration. - Commented out not needed
for-each
loop. - Used ancestor axis to get the poNumber just once.
<?xml version='1.0'?>
<xsl:stylesheet xmlns:link="http://www.cws.com/Schemas/UN/2011/11"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns0="http://ua.com/3pl/FMS/XSDLibrary"
xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns:dt="urn:schemas-microsoft-com:datatypes"
xmlns:gt="http://www.gtech.com/lsp/2009-09-23"
version="2.0"
exclude-result-prefixes="ns0 ms dt gt">
<xsl:output indent="yes"
method="xml"
omit-xml-declaration="yes"/>
<xsl:template match="/link:UniversalInterchange">
<isfData>
<manufacturer>
<xsl:for-each select="link:Body/link:UniversalShipment/link:Shipment/link:SubShipmentCollection/link:SubShipment">
<manufacturerName>
<xsl:value-of select="link:OrganizationAddressCollection/link:OrganizationAddress[link:AddressType='Manufacturer']/link:CompanyName"/>
</manufacturerName>
<address1>
<xsl:value-of select="link:OrganizationAddressCollection/link:OrganizationAddress[link:AddressType='Manufacturer']/link:Address1"/>
</address1>
<address2>
<xsl:value-of select="link:OrganizationAddressCollection/link:OrganizationAddress[link:AddressType='Manufacturer']/link:Address2"/>
</address2>
<city>
<xsl:value-of select="link:OrganizationAddressCollection/link:OrganizationAddress[link:AddressType='Manufacturer']/link:City"/>
</city>
<countryCode>
<xsl:value-of select="link:OrganizationAddressCollection/link:OrganizationAddress[link:AddressType='Manufacturer']/link:Country/link:Code"/>
</countryCode>
<postalCode>
<xsl:value-of select="link:OrganizationAddressCollection/link:OrganizationAddress[link:AddressType='Manufacturer']/link:Postcode"/>
</postalCode>
</xsl:for-each>
<xsl:for-each select="link:Body/link:UniversalShipment/link:Shipment/link:SubShipmentCollection/link:SubShipment/link:RelatedShipmentCollection/link:RelatedShipment/link:Order/link:OrderLineCollection/link:OrderLine">
<itemInfo>
<!--<xsl:for-each select="//link:RelatedShipment/link:Order/link:OrderNumber[1]">-->
<poNumber>
<!--<xsl:value-of select="."/>-->
<xsl:value-of select="ancestor::link:Order/link:OrderNumber"/>
</poNumber>
<!--</xsl:for-each>-->
<itemDescription>BUCKET BAG</itemDescription>
<countryOrigin>ID</countryOrigin>
<quantity>
<xsl:value-of select="link:PackageQty"/>
</quantity>
</itemInfo>
</xsl:for-each>
</manufacturer>
</isfData>
</xsl:template>
</xsl:stylesheet>