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