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!

XSLT REMOVE DUPLICATE NODES

794954Apr 11 2014 — edited Apr 11 2014

Hi,

I am new to XSLT and struggling to create one for the below requirement. Any help would be appreciated.

Below is the request Xml which i need to transform

<ListOfProducts>

<Product>

<ProductId>1</ProductId>

<ProductName>New Product</ProductName>

<EffectiveDate>2014-02-13</EffectiveDate>

<ProdDescription>Test</ProdDescription>

<ProductCategory>

<CategoryID>4013</CategoryId>

<SubCategory>

<SubCategoryId>2051</SubCategoryId>

<SubCategoryName/>

<EffectiveDate>2014-02-13</EffectiveDate>

</SubCategory>

</ProductCategory>

</Product>

<Product>

<ProductId>2</ProductId>

<ProductName>New Product</ProductName>

<EffectiveDate>2014-02-13</EffectiveDate>

<ProdDescription>Test</ProdDescription>

<ProductCategory>

<CategoryID>4013</CategoryId>

<SubCategory>

<SubCategoryId>2051</SubCategoryId>

<SubCategoryName/>

<EffectiveDate>2014-02-13</EffectiveDate>

</SubCategory>

</ProductCategory>

</Product>

<Product>

<ProductId>1</ProductId>

<ProductName>New Product</ProductName>

<EffectiveDate>2014-02-13</EffectiveDate>

<ProdDescription>Test</ProdDescription>

<ProductCategory>

<CategoryID>4013</CategoryId>

<SubCategory>

<SubCategoryId>2051</SubCategoryId>

<SubCategoryName/>

<EffectiveDate>2014-02-13</EffectiveDate>

</SubCategory>

</ProductCategory>

</Product>

</ListOfProducts>

I need to transform this request to the below format removing the duplicate product based on ProductId

<ListOfProducts>

<Product>

<ProductId>1</ProductId>

<ProductName>New Product</ProductName>

<EffectiveDate>2014-02-13</EffectiveDate>

<ProdDescription>Test</ProdDescription>

<ProductCategory>

<CategoryID>4013</CategoryId>

<SubCategory>

<SubCategoryId>2051</SubCategoryId>

<SubCategoryName/>

<EffectiveDate>2014-02-13</EffectiveDate>

</SubCategory>

</ProductCategory>

</Product>

<Product>

<ProductId>2</ProductId>

<ProductName>New Product</ProductName>

<EffectiveDate>2014-02-13</EffectiveDate>

<ProdDescription>Test</ProdDescription>

<ProductCategory>

<CategoryID>4013</CategoryId>

<SubCategory>

<SubCategoryId>2051</SubCategoryId>

<SubCategoryName/>

<EffectiveDate>2014-02-13</EffectiveDate>

</SubCategory>

</ProductCategory>

</Product>

<Product>

</ListOfProducts>

I have many other elements similar to this other than product.

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 9 2014
Added on Apr 11 2014
1 comment
654 views