Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Eliminate duplicates using XSLT

KANNNov 28 2016 — edited Feb 26 2020

Hi,

We are receiving promo codes at line level as apart of Order XML. The XML looks like following :

<OrderLines>

<ItemOut quantity="1" lineNumber="1">

<ItemID>
<SupplierPartID>12345</SupplierPartID>
<SupplierPartAuxiliaryID>punchoutA8E6F8D173284CF2B0E6FA782A1289FD|PROMO:BGM15</SupplierPartAuxiliaryID>
</ItemID>
<ItemDetail>
<UnitPrice>
<Money currency="USD">279.00</Money>
</UnitPrice>
<Description xml:lang="en-US">Item description</Description>
<UnitOfMeasure>EA</UnitOfMeasure>
<Classification domain="ABCDEF">00000001</Classification>
<ManufacturerPartID/>
<ManufacturerName/>
</ItemDetail>
</ItemOut>
<ItemOut quantity="1" lineNumber="2">
<ItemID>
<SupplierPartID>67890</SupplierPartID>
<SupplierPartAuxiliaryID>punchout8D4BB4447E654F028CC4EE77F885EFA9|PROMO:BGM16</SupplierPartAuxiliaryID>
</ItemID>
<ItemDetail>
<UnitPrice>
<Money currency="USD">239.00</Money>
</UnitPrice>
<Description xml:lang="en-US">Item description</Description>
<UnitOfMeasure>EA</UnitOfMeasure>
<Classification domain="ABCDEF">00000001</Classification>
<ManufacturerPartID/>
<ManufacturerName/>
</ItemDetail>
</ItemOut>
<ItemOut quantity="1" lineNumber="3">
<ItemID>
<SupplierPartID>01985</SupplierPartID>
<SupplierPartAuxiliaryID>punchout29D420BD1FEB48B5A82949EB007D6614|PROMO:BGM16</SupplierPartAuxiliaryID>
</ItemID>
<ItemDetail>
<UnitPrice>
<Money currency="USD">279.00</Money>
</UnitPrice>
<Description xml:lang="en-US">Item description</Description>
<UnitOfMeasure>EA</UnitOfMeasure>
<Classification domain="ABCDEF">00000001</Classification>
<ManufacturerPartID/>
<ManufacturerName/>
</ItemDetail>

</ItemOut>

</OrderLines>

Following is the XSL using to get promo-codes:

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

<xsl:stylesheet version="1.0"

                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:template match="/">

        <xsl:for-each select="OrderLines/ItemOut/ItemID">  

            <xsl:value-of select="substring-after(SupplierPartAuxiliaryID,'|')"/>   

        </xsl:for-each>

    </xsl:template>  

</xsl:stylesheet> 

How to eliminate duplicate promo-codes as in line 2 and 3. Please advice.

Thanks,

KANN

This post has been answered by Vidya Bhushan Tipparaju on Nov 30 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 28 2016
Added on Nov 28 2016
2 comments
1,237 views